我正在尝试使用以下方法创建文件:
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'.
有什么建议吗?
答案 0 :(得分:1)
尝试以下
tempemail
存在