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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect to a certain drive on a server box by IP address programmatically

Status
Not open for further replies.

IlyaRabyy

Programmer
Nov 9, 2010
571
US
Colleagues,
Let's say you have an IP address and the drive letter on a remote server box, and you need to connect to this remote box your program's server box, so your program could, say, copy some files back-n-forth.
Just for argument sake, IP address is 123.456.78.90 and the drive letter is D:\.
(Tried to find it in the MS documentation on line, but all references came related to ADO .NET, SqlConnection, etc. - not what I need...)
Please advise.
TIA!

Regards,

Ilya
 
Is it shared? Do you have correct permissions on the share?

I ask, because most file-accessing components in .NET understand UNC file paths.

So for example the following works fine:

Code:
[blue]If FileIO.FileSystem.DirectoryExists("\\192.168.1.106\D$\.") Then
     MsgBox("I can see the D drive on server with IP 192.168.1.106")
End If[/blue]

 
Yes, Strongm, I know this.
Apologies, it seems I formulated my question incorrectly, it should be:

How do I, the Program, log into a server box on run time programmatically, provided that I, the Program, am not a person who can type in the U/N and P/W?

(No need to call the police, FCC, FBI, NSA, DHS, ICC, UN, etc. ( [wink] ): the task is to send the PDFs with HR info from us, vendor/provider to a web server where our clients' employees can download them.)


Regards,

Ilya
 
send the PDFs [...] to [...] our clients' employees"

Hmm.. my simple mind says: e-mail them as attachments [ponder]


---- Andy

There is a great need for a sarcasm font.
 
Code:
[blue]   Process.Start("CMD", "/c net use \\192.168.1.80\Home /user:<username> <password>")
    If FileIO.FileSystem.DirectoryExists("\\192.168.1.80\Home\backups") Then
        MsgBox("I can see the folder on that IP")
    End If
    Process.Start("CMD", "/c Net use /delete \\192.168.1.80\Home")[/blue]

But the success of this will very much depend on how the remote box is set up. In my case, for example, I was testing against a NAS on my local network running SMB, and with all relevant firewalls configured to allow SMB traffic.
 
Andrzejek said:
e-mail them as attachments

Not an option. Imagine a client with 1.5K employees all over the US and Canada...

Regards,

Ilya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top