|
-
Jul 21st, 2018, 03:08 AM
#1
Thread Starter
Junior Member
Server Error in '/' Application. Could not find a part of the path
I'm trying to delete XML files on button click, the files are in the XML folder on my site (in smarterasp.net hosting) using this code :
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
Dim directoryName As String = MapPath("~/xml/")
For Each deleteFile In Directory.GetFiles(directoryName, "*.xml", SearchOption.TopDirectoryOnly)
File.Delete(deleteFile)
Next
Label1.Text = "done"
End Sub
but I got this error :
Server Error in '/' Application.
Could not find a part of the path 'C:\Windows\SysWOW64\inetsrv\karary-001-
site1.htempurl.com\xml'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.IO.DirectoryNotFoundException: Could not find a
part of the path 'C:\Windows\SysWOW64\inetsrv\karary-001-
site1.htempurl.com\xml'.
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[DirectoryNotFoundException: Could not find a part of the path
'C:\Windows\SysWOW64\inetsrv\karary-001-site1.htempurl.com\xml'.]
what is right way to get the folder, I have tried those :
1- http://karary-001-site1.htempurl.com/xml/
2- h:\root\home\karary-001\www\site1\xml\
3- ~/xml/
Tags for this Thread
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
|
Click Here to Expand Forum to Full Width
|