0
我試圖用創建一個文件:File.open文件創建錯誤
Dim stmFile As Stream = File.Open(filename, FileMode.OpenOrCreate, FileAccess.Write)
這應該創建一個文件中指定的文件目前不存在但相反,它拋出一個服務器錯誤:
Could not find a part of the path 'c:\tempemail\681968_File.doc'.
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:\tempemail\681968_File.doc'.
有什麼建議嗎?
你傳遞給文件名的值是「c:\ tempemail \ 681968_File.doc」還是「c:\\ tempemail \ 681968_File.doc」? –
tempemail目錄是否已經存在? – bUKaneer
Filename =「c:\ tempemail \ 681974_File.doc」 –