Connecting to a file share in C# - HELP

  • Thread starter Thread starter BillGatesFan
  • Start date Start date
B

BillGatesFan

I want to be able to connect to a file share in C# given a username
and password.

Any help would be appreciated. Code examples welcomed
 
Hello BillGatesFan,

There are 2 solutions
1) Using Win32 API to create logon session "LogonUser" method
2) using Win32 API WNetAddConnection3

Google for sample http://groups.google.com/groups/search?q=dotnet+file+share+pass+credentials


---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

B> I want to be able to connect to a file share in C# given a username
B> and password.
B>
B> Any help would be appreciated. Code examples welcomed
B>
 
Hello BillGatesFan,

There are 2 solutions
1) Using Win32 API to create logon session "LogonUser" method
2) using Win32 API WNetAddConnection3

Google for samplehttp://groups.google.com/groups/search?q=dotnet+file+share+pass+crede...

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

B> I want to be able to connect to a file share in C# given a username
B> and password.
B>
B> Any help would be appreciated. Code examples welcomed
B>

How to call garbage collection in C# programming?
need some help
 
First - the important question is "why?"; as a general rule, leave it
alone - it knows what it is doing.

However: GC.Collect() may do the job, but nothing is guaranteed.

Marc
 
Back
Top