473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

Oct 3 '06 #1
3 5280
'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
Oct 4 '06 #2
Pete,

Have a look at the webrequest class

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps,

Cor

"Pete" <si*****@msu.eduschreef in bericht
news:11**********************@m7g2000cwm.googlegro ups.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

Oct 4 '06 #3
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:
'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
Oct 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lawrence | last post by:
Google can't find me a good example of how to use the "if exists" syntax in MySql. Is it right that to use it this way: INSERT INTO IF EXISTS tMyTable VALUES("xxlk", "lkjlkjlkjljk") I want...
3
by: Hugz | last post by:
Hello, And Thank you for taking time to help me.Myself Hugz.I am new to perl and want to write my own Scripts.But i can't understand how perl "rename" function and "file locking" works. ...
24
by: AES/newspost | last post by:
On many web sites or pages (including my own home page) clicking on certain links will start downloading a PDF file, sometimes without the author having provided any warning in the text of the page...
2
by: OutdoorGuy | last post by:
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take...
1
by: Rajeshwar_ts | last post by:
Hi, I am new to this group and new to PostGreSql. i am changing from MySql to PostGresql. I am unable to work with "Drop table if exists tablename" query. Is there any alternate query for...
17
by: haldie | last post by:
Well, a long time ago, some bright person got a hold of my computer and decided to "improve" it. Apparently they fouled up the default "open" option on the folder "file type," causing a folder to...
10
by: vunet.us | last post by:
What is the workaround of passign a parameter to any included asp file: <!-- #Include File="file.asp" --> This obviously does not work: <!-- #Include File="file.asp?id=123" --> Thank you
9
shrek123
by: shrek123 | last post by:
How to write to a ".txt" file present on remote machine. I dont want to use two way socket connection. Is there any other way to write to a file on remote machine? Best Regards, Shrek.
7
by: itsraghz | last post by:
Hello All, I remember in MySQL we do have "IF EXISTS", 'IF NOT EXISTS" clause/keyword in the DDL statements (CREATE,DROP etc.,) to avoid unnecessary bombing. Do we have such facility in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.