Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a way to access a network share in VB.NET

Status
Not open for further replies.

cjinsocal581

Programmer
Feb 5, 2005
168
US
I need my VB.NET app to access a hidden share that is on the local network.

I then need to be able to list the folders on that hidden share.

Then, finally list the files within a selected folder using the GetFiles function.

Here is my path:
Private strPath As String = "\\10.1.1.106\cjdev$"

Now, I have been told to impersonate the credentials and I just do not know how to do that.

Any ideas would be greatly appreciated.


Regards,
CJ
 
The solution that I used was the WNetAddConnection2 and WNetCancelConnection2 API calls.

WNetAddConnection2:
WNetCancelConnection2:
These API calls will create a network connection just like when you issue a net use from the command prompt or when you access a share and are prompted for a username and password by windows.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top