Click here to Skip to main content
16,013,338 members
Home / Discussions / C#
   

C#

 
GeneralDrive Share account Pin
Guinness4Strength19-Jun-04 2:49
Guinness4Strength19-Jun-04 2:49 
GeneralRe: Drive Share account Pin
Heath Stewart19-Jun-04 7:03
protectorHeath Stewart19-Jun-04 7:03 
GeneralRe: Drive Share account Pin
Guinness4Strength19-Jun-04 11:15
Guinness4Strength19-Jun-04 11:15 
GeneralRe: Drive Share account Pin
Heath Stewart20-Jun-04 9:50
protectorHeath Stewart20-Jun-04 9:50 
GeneralRe: Drive Share account Pin
Guinness4Strength21-Jun-04 5:22
Guinness4Strength21-Jun-04 5:22 
GeneralRe: Drive Share account Pin
Heath Stewart21-Jun-04 5:26
protectorHeath Stewart21-Jun-04 5:26 
GeneralRe: Drive Share account Pin
Heath Stewart21-Jun-04 5:27
protectorHeath Stewart21-Jun-04 5:27 
GeneralRe: Drive Share account Pin
Guinness4Strength21-Jun-04 5:50
Guinness4Strength21-Jun-04 5:50 
ok, now I get an return code of 0, which I'm assuming is the NErr_Success code, with the following code.
[DllImport("NetApi32.dll",CharSet=CharSet.Unicode)] private static extern int NetUseGetInfo(string SrvrName,string MappedDrive,int Level,ref structUSE_INFO_2 MapInfo);
[DllImport("NetApi32.dll",CharSet=CharSet.Unicode)] private static extern int NetApiBufferFree(ref structUSE_INFO_2 MapInfo);


[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
private struct structUSE_INFO_2
{
	public string sLocal;
	public string sRemote;
	public string sPassword;
	public int iType;
	public int iRefCount;
	public int iUseCount;
	public string sUsername;
	public string sDomain;
}
...
...
...

structUSE_INFO_2 MappInfo = new structUSE_INFO_2();
int Err=NetUseGetInfo(null,DriveLetter,2,ref MappInfo);
Username=MappInfo.sUsername;
Err=NetApiBufferFree(ref MappInfo);

However the when I interrogate the structUSE_INFO_2 structure, all the memebers are null. Do I need to set any of the USE_INFO_2 members to a value first ? I didn't see any documentation on it.
GeneralRe: Drive Share account Pin
Heath Stewart21-Jun-04 6:26
protectorHeath Stewart21-Jun-04 6:26 
GeneralRe: Drive Share account Pin
Guinness4Strength21-Jun-04 8:13
Guinness4Strength21-Jun-04 8:13 
QuestionHow repaint the color of ColumnHead in ListView? Pin
fu019-Jun-04 1:31
fu019-Jun-04 1:31 
AnswerRe: How repaint the color of ColumnHead in ListView? Pin
Heath Stewart19-Jun-04 6:58
protectorHeath Stewart19-Jun-04 6:58 
Generalform at runtime Pin
Member 114126618-Jun-04 22:45
Member 114126618-Jun-04 22:45 
GeneralRe: form at runtime Pin
Heath Stewart19-Jun-04 7:00
protectorHeath Stewart19-Jun-04 7:00 
GeneralYahoo and C# Pin
MeterMan18-Jun-04 21:55
MeterMan18-Jun-04 21:55 
GeneralRe: Yahoo and C# Pin
Nick Parker19-Jun-04 4:41
protectorNick Parker19-Jun-04 4:41 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 6:44
MeterMan19-Jun-04 6:44 
GeneralRe: Yahoo and C# Pin
Heath Stewart19-Jun-04 6:50
protectorHeath Stewart19-Jun-04 6:50 
GeneralRe: Yahoo and C# Pin
Heath Stewart19-Jun-04 6:48
protectorHeath Stewart19-Jun-04 6:48 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 10:14
MeterMan19-Jun-04 10:14 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 15:24
eggie519-Jun-04 15:24 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 15:51
eggie519-Jun-04 15:51 
GeneralRe: Yahoo and C# Pin
MeterMan19-Jun-04 16:41
MeterMan19-Jun-04 16:41 
GeneralRe: Yahoo and C# Pin
eggie519-Jun-04 16:46
eggie519-Jun-04 16:46 
GeneralRe: Yahoo and C# Pin
Heath Stewart20-Jun-04 9:46
protectorHeath Stewart20-Jun-04 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.