Borland
XP, 2000에서 로그온된 사용자 이름 불러오기
leo21c
2008. 3. 4. 15:26
| ||||||||
| 1. 로그온된 사용자의 이름 GetUserNameA 를 이용해서 ... void __fastcall TForm1::Button1Click(TObject *Sender) { char buf[128]; int size=128; GetUserNameA(buf,(unsigned long *)&size); ShowMessage(buf); } 쿠키폴더도 이렇게 찾을순 있겠죠? 2. 쿠키폴더 찾기 SHGetSpecialFolderLocation 이라는 특수폴더 경로 찾는 함수가 있습니다. #include <vcl.h> #define FVSHOWINFO xxFVSHOWINFOxx #define FOLDERSETTINGS xxFOLDERSETTINGSxx #define DESKBANDINFO xxDESKBANDINFOxx #define SHELLFLAGSTATE xxSHELLFLAGSTATExx #include <shlobj.h> #pragma hdrstop String __fastcall GetSpecialFolderPath(int nFolder) { char path[MAX_PATH]; AnsiString strPath(""); LPITEMIDLIST piidl; try{ if(SHGetSpecialFolderLocation(NULL,nFolder,&piidl)!=NOERROR) return strPath; if(!SHGetPathFromIDList(piidl, path)) return strPath; strPath=path; //if(strPath[strPath.Length()]!='\\') strPath=strPath+"\\"; }catch(Exception &e){ } return strPath; } void __fastcall TForm1::Button2Click(TObject *Sender) { ShowMessage(GetSpecialFolderPath(CSIDL_COOKIES)); } //--------------------------------------------------------------------------- SHGetSpecialFolderLocation 이 함수로 쿠키폴더 뿐만 아니라 여러가지 특수폴더를 알아낼수 있습니다. SHGetSpecialFolderLocation로 여기 검색해보세요 그럼.. |
LIST