Exception Details: System.Web.HttpException: 'c:/users/agaabhis/documents/visual studio 2010/Projects/WebApplication4/WebApplication4/Files/' is a physical path, but a virtual path was expected.Asp.net使用從Excel C#文件上傳的SQL Server 08
源錯誤:
Line 23: Line 24: //Upload and save the file Line 25:
string excelPath = Server.MapPath("c://users/agaabhis/documents/visual studio 2010/Projects/WebApplication4/WebApplication4/Files/") + Path.GetFileName(FileUpload1.PostedFile.FileName); Line 26:
FileUpload1.SaveAs(excelPath); Line 27:
Source File: c:\users\agaabhis\documents\visual studio 2010\Projects\WebApplication4\WebApplication4\Default.aspx.cs Line: 25
有一點信息會很有幫助,例如:你的源代碼。 –