您好,我在ASP.NET(网站)项目中有一个页面,它将文件写入app_data文件夹。
当我从浏览器请求页面时,一切正常。
当我从提供程序的cron作业调度作业执行此请求时,会收到以下错误
Could not find a part of the path 'C:\xxxxxxxxxxxxxxx\App_Data\Art_P00004.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.IO.File.CreateText(String path)
at AanbiedingProcessor.DoWriteFiles()
at TskSendAanbiedingen.DoWork()
有人能帮我吗?
cron jon作为ASP.NET网站运行在另一个主机/域上。我假设它只是发出一个Web请求。