-
Need help checking if file is already saved VB.Net 03
Hello,
I am trying to write the code in VB.Net 03 to save a file to a location (C:\) and I would like for when I attempt to save a document to that location to make sure a document with the same name is not already saved and return a message that says file already exists would you like to replace. For example I would like for when I click the button to attempt to save the file to the location and if that file already exists give a message in a text box. I know how to save the file the problem is checking for the file (i.e. maybe an if statement). I'm not sure what code to write to check for the file in that location. Any suggestions would be greatly appreciated. Thank you for your help.
Here's the first part of the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AutoSave.Click
Dim b As Integer
Dim itemID As String
Dim location As String
Dim type As String
Dim storage As String
itemID = eBSS1.ActiveCell.Previous.Value.ToString
location = "C:\"
type = ".mht"
storage = (location & itemID & type)
'Im assuming an if statement can be inserted here but I'm not sure how to write the code to check
SavePage(eBSS1.ActiveCell.Text, storage)
End Sub
-
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Similar Threads
-
By jase_dukerider in forum C++
Replies: 2
Last Post: 04-14-2005, 07:48 PM
-
By Phil Weber in forum .NET
Replies: 0
Last Post: 12-04-2001, 09:40 PM
-
By Siri Mette Haugerud in forum VB Classic
Replies: 0
Last Post: 06-26-2001, 11:44 AM
-
By James Abbott in forum VB Classic
Replies: 0
Last Post: 05-29-2001, 04:52 AM
-
By Lim Wing Hoe in forum Java
Replies: 2
Last Post: 12-27-2000, 05:22 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|