 |
|
Create ไฟล์ CSV แล้วขึ้น Could not find a part of the path ค่ะ |
|
 |
|
|
 |
 |
|
Create ไฟล์ CSV แล้วขึ้น Could not find a part of the path ค่ะ
Code
Could not find a part of the path 'C:\WINXP\system32\txt\BM_SSPTH_Txn_0001_20120221.csv'.
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:\WINXP\system32\txt\BM_SSPTH_Txn_0001_20120221.csv'.
Source Error:
Line 169: string dt1 = convDT.To_yyyyMMdd(DateTime.Today);
Line 170:
Line 171: FileStream fs = new FileStream(@"txt\\BM_SSPTH_Txn_0001_" + dt1 + ".csv", FileMode.Create);
Line 172: StreamWriter sw = new StreamWriter(fs);
Line 173: sw.WriteLine("File Date" + "," + "Source of Input" + "," + "BIG Reward ID" + "," + "Txn Date" + "," + "Txn Type" + "," + "Amt Txn" + "," + "BIGGIES Txn" + "," + "TxnDescription" + "," + "RefKey" + "," + "MID");
Source File: c:\Inetpub\wwwroot\Biggie\information.aspx.cs Line: 171
เวลา Debug ในโปรแกรมสร้างได้ค่ะ ตาม path ที่กำหนด แต่พอเรียกรันผ่าน iis จะขึ้นแบบด้านบนค่ะ แก้ยังไงค่ะ
VS2005 - C# - .NET v4.xx - Ms Access
Tag : .NET, Ms Access, Web (ASP.NET), C#, VS 2005 (.NET 2.x)
|
|
 |
 |
 |
 |
Date :
2012-02-21 23:16:15 |
By :
Aor |
View :
2553 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าบนเว็บน่าจะต้องใช้ Server.MapPath ครับ
Code (C#)
FileStream fs = new FileStream(Server.MapPath("txt\\BM_SSPTH_Txn_0001_" + dt1 + ".csv"), FileMode.Create);
|
 |
 |
 |
 |
Date :
2012-02-22 06:49:24 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรวจสอบเรื่อง Security ในการเข้าถึง Folder ครับ ถ้าจำไม่ผิดเคยเห็นแว๊บๆ
|
 |
 |
 |
 |
Date :
2012-02-22 08:39:31 |
By :
13crowns |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|