Document

S

samoore33

Is there a way to check and see if a document exists when an app loads?
The first time the user starts the app, I want it to check and see if
an XML document exists, which it shouldn't. Therefore it will write out
the xml document needed for the app.

Thanks
 
S

sweet_dreams

samoore33 napisal(a):
Is there a way to check and see if a document exists when an app loads?
The first time the user starts the app, I want it to check and see if
an XML document exists, which it shouldn't. Therefore it will write out
the xml document needed for the app.

Thanks

Hi samoore33,

You can do ity like that:


Dim DocPath As String = "C:\1.xml"
Dim XMlFile As New FileInfo(DocPath)

If XMlFile.Exists = True Then
MessageBox.Show("Exists")
End If

You have to import System.IO namespace

Hope this helps.

Regards,
sweet_dreams
 
H

Herfried K. Wagner [MVP]

samoore33 said:
Is there a way to check and see if a document exists when an app loads?
The first time the user starts the app, I want it to check and see if
an XML document exists, which it shouldn't. Therefore it will write out
the xml document needed for the app.

'System.IO.File.Exists'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top