Asp.net| Create | problem
The IO classes in. NET in C # are powerful, but they are not practical in many virtual service servers because of their powerful features. Because Io.directory and Io.directoryinfo in the application folder operation, will traverse the Web site's hard disk and directory, the general virtual service provider does not give the disk Network service users to open read access, so in the operation of the folder, The following error occurs with these two classes under IO
A part of the path "E:\" was not found.
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.
Exception Details: System.IO.DirectoryNotFoundException: Part of the path "E:\" was not found.
SOURCE Error:
An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace to determine information about the cause of the exception and where it occurred.
Stack trace:
[DirectoryNotFoundException: Part of the path ' e:\ ' was not found. ]
System.io.__error.winioerror (Int32 errorcode, String str) +287
System.IO.Directory.InternalCreateDirectory (string fullpath, String path)
+489system.io.directory.createdirectory (String Path)
+195system.io.directory.createdirectory (String Path)
+195system.io.directory.createdirectory (String Path)
+195system.io.directory.createdirectory (String Path)
+195
System.IO.Directory.CreateDirectory (String path) +195
--------------------------------------------------------------------------------
Version information: Microsoft. NET Framework Version: 1.1.4322.2300; asp.net version: 1.1.4322.2300
The path e:/,e disk is not found on the server, and may vary depending on the server. Faced with this problem, the service provider will not give you more permission to open the case, how to solve it?
Oh, may be because I am relatively poor foundation, so the internet to seek answers, but hard to find the answer. Accidental once, found that ASP can apply FSO to create folders. So I thought of using asp.net to invoke the FSO component in window. Oh, incredibly successful, close-up this article to those who suffer from this problem should not be resolved friends and brothers.
Project-> References Browse COM components Microsoft scripting Runtime
Scripting.FileSystemObject fso=new Scripting.filesystemobjectclass ();
Fso. CreateFolder (Path)
, but this solution is based on the premise that the virtual service provider opened the FSO
As for the IO Operation folder Two classes why will traverse the disk root directory is still in the study, but the problem is finally solved, I hope that people who know this can give you an answer.