|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
test "file exists" on remote computer?I successfully use "My.Computer.Network.DownloadFile", including the
authentication data, but I would appreciate learning how to first test whether the file exists on the remote computer. Thanks. - Pete 'Create a string for the file path
Dim strPath As String = "C:\MyDirectory\MyFile.txt" If System.IO.File.Exists(strPath) Then 'Your Code here End If you can also use UNC paths as well "\\computername\MyDirectory\Myfile.txt" Pete wrote: Show quoteHide quote > I successfully use "My.Computer.Network.DownloadFile", including the > authentication data, but I would appreciate learning how to first test > whether the file exists on the remote computer. Thanks. > - Pete Thanks, but could you please tell me how the username and password get
transmitted using "System.IO.File.Exists". They were just args of "My.Computer.Network.DownloadFile". - Pete Charlie Brown wrote: Show quoteHide quote > 'Create a string for the file path > Dim strPath As String = "C:\MyDirectory\MyFile.txt" > If System.IO.File.Exists(strPath) Then > 'Your Code here > End If > > you can also use UNC paths as well > "\\computername\MyDirectory\Myfile.txt" > > Pete wrote: > > I successfully use "My.Computer.Network.DownloadFile", including the > > authentication data, but I would appreciate learning how to first test > > whether the file exists on the remote computer. Thanks. > > - Pete Pete,
Have a look at the webrequest class http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebrequestclasstopic.asp I hope this helps, Cor Show quoteHide quote "Pete" <sign***@msu.edu> schreef in bericht news:1159911063.333381.136660@m7g2000cwm.googlegroups.com... >I successfully use "My.Computer.Network.DownloadFile", including the > authentication data, but I would appreciate learning how to first test > whether the file exists on the remote computer. Thanks. > - Pete >
.NET 2 recommended books?
Sending email with attachments Data Set to Excel ? vb.net serial IO problem writing commands to command prompt in VB.NET Open folders to process files automatically Datetimepicker - just getting the data part ComboBox.Items.Clear() SelectedIndexChanged causes selectedindex to reset to -1? How hard would this be? |
|||||||||||||||||||||||