The .Text program has been running well in the local, and the album uploaded to the server has not been used normally. I found the reason. It turned out that the server could not use the program to create a directory, which is not supported for Directory.createDirectory, and upload a problem No, there is no problem locally, too strange, online search for a long time, I can't find a solution, Best can't understand!
Below is a test program, running on the server as follows: d: / *** / upload / mynewtest: No part of the path "D: /" is found.
The program is no problem, it seems that it is definitely the server, the permissions should be no problem, and then I finally tried to finally know: It turned out to add permissions that the User group can be accessed in the D disk. No wonder the old prompt did not find part of the path "D: /".
<% @ import namespace = "system"%> <% @ import namespace = "system.io"%>
Void Page_Load (Object Sender, Eventargs E) {
}
void Button_Create (object sender, EventArgs e) {string dir = ""; try {dir = Server.MapPath ( "mynewtest"); Directory.CreateDirectory (dir);} catch (DirectoryNotFoundException ex) {Response.Write (dir ": " EX.MESSAGE);}}
script>