I'm trying to create a directory on the web server with a
vb.net code:
....
Dim dirName As String = "w:\filepath\im ages"
If Not Directory.Exist s(dirName) Then
Directory.Creat eDirectory(dirN ame)
Label1.Text = "Directory created"
Else
Label1.Text = "Directory exists"
End If
....
And I'm getting an exception:
Could not find a part of the path "w:\".
Exception Details: System.IO.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".
When I run it with "w:\filepat h\" it says "Directory
exists". Only when I want to create a new directory the
exception occurs. The ASP.NET user has all rights on that
drive, and there would be another exception
like ... "access to path denied".
Does anyone knows what is going on here and what does it
mean "could not find a part of the path"?
I can run this code locally and it works fine, the problem
is only at my webservers host computer.
Regards
Matthias
ps here the full exception:
Could not find a part of the path "w:\".
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.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".
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:
[DirectoryNotFou ndException: Could not find a part of the
path "w:\".]
System.IO.__Err or.WinIOError(I nt32 errorCode, String
str) +287
System.IO.Direc tory.InternalCr eateDirectory(S tring
fullPath, String path) +489
System.IO.Direc tory.CreateDire ctory(String path) +195
config.test.But ton1_Click(Obje ct sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
+108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEve
ntHandler.Raise PostBackEvent(S tring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent
(IPostBackEvent Handler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent
(NameValueColle ction postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277
-----------------------------------------------------------
---------------------
Version Information: Microsoft .NET Framework
Version:1.1.432 2.573; ASP.NET Version:1.1.432 2.573
vb.net code:
....
Dim dirName As String = "w:\filepath\im ages"
If Not Directory.Exist s(dirName) Then
Directory.Creat eDirectory(dirN ame)
Label1.Text = "Directory created"
Else
Label1.Text = "Directory exists"
End If
....
And I'm getting an exception:
Could not find a part of the path "w:\".
Exception Details: System.IO.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".
When I run it with "w:\filepat h\" it says "Directory
exists". Only when I want to create a new directory the
exception occurs. The ASP.NET user has all rights on that
drive, and there would be another exception
like ... "access to path denied".
Does anyone knows what is going on here and what does it
mean "could not find a part of the path"?
I can run this code locally and it works fine, the problem
is only at my webservers host computer.
Regards
Matthias
ps here the full exception:
Could not find a part of the path "w:\".
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.Direc toryNotFoundExc eption:
Could not find a part of the path "w:\".
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:
[DirectoryNotFou ndException: Could not find a part of the
path "w:\".]
System.IO.__Err or.WinIOError(I nt32 errorCode, String
str) +287
System.IO.Direc tory.InternalCr eateDirectory(S tring
fullPath, String path) +489
System.IO.Direc tory.CreateDire ctory(String path) +195
config.test.But ton1_Click(Obje ct sender, EventArgs e)
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e)
+108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEve
ntHandler.Raise PostBackEvent(S tring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent
(IPostBackEvent Handler sourceControl, String
eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent
(NameValueColle ction postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277
-----------------------------------------------------------
---------------------
Version Information: Microsoft .NET Framework
Version:1.1.432 2.573; ASP.NET Version:1.1.432 2.573
Comment