我是个新手,从51aspx上下了个源代码,电脑是WIN7,已经做好VS2005+SQL2005的数据库连接,不过现在调试网站一直出现“未能找到路径”。具体如下:
“/xkdoc”应用程序中的服务器错误。
--------------------------------------------------------------------------------未能找到路径“E:\downcode\选课系统\time.txt”的一部分。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.DirectoryNotFoundException: 未能找到路径“E:\downcode\选课系统\time.txt”的一部分。源错误:
行 89: public static int CheckTime()
行 90: {
行 91: StreamReader sr = new StreamReader(ConfigurationSettings.AppSettings["time.txt"]);
行 92: string strStart = sr.ReadLine();
行 93: string strEnd = sr.ReadLine();
源文件: c:\xkdoc\App_Code\MyUtility.cs 行: 91 堆栈跟踪:
[DirectoryNotFoundException: 未能找到路径“E:\downcode\选课系统\time.txt”的一部分。]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
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) +1162
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +65
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +87
System.IO.StreamReader..ctor(String path) +30
sc.MyUtility.CheckTime() in c:\xkdoc\App_Code\MyUtility.cs:91
sc.Login.Page_Load(Object sender, EventArgs e) in c:\xkdoc\Login.aspx.cs:26
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
System.Web.UI.Control.OnLoad(EventArgs e) +73
System.Web.UI.Control.LoadRecursive() +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2184
请各位大侠帮帮我,我现在真的狠无助55555谢谢大家了~!
“/xkdoc”应用程序中的服务器错误。
--------------------------------------------------------------------------------未能找到路径“E:\downcode\选课系统\time.txt”的一部分。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.IO.DirectoryNotFoundException: 未能找到路径“E:\downcode\选课系统\time.txt”的一部分。源错误:
行 89: public static int CheckTime()
行 90: {
行 91: StreamReader sr = new StreamReader(ConfigurationSettings.AppSettings["time.txt"]);
行 92: string strStart = sr.ReadLine();
行 93: string strEnd = sr.ReadLine();
源文件: c:\xkdoc\App_Code\MyUtility.cs 行: 91 堆栈跟踪:
[DirectoryNotFoundException: 未能找到路径“E:\downcode\选课系统\time.txt”的一部分。]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
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) +1162
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +65
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +87
System.IO.StreamReader..ctor(String path) +30
sc.MyUtility.CheckTime() in c:\xkdoc\App_Code\MyUtility.cs:91
sc.Login.Page_Load(Object sender, EventArgs e) in c:\xkdoc\Login.aspx.cs:26
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43
System.Web.UI.Control.OnLoad(EventArgs e) +73
System.Web.UI.Control.LoadRecursive() +52
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2184
请各位大侠帮帮我,我现在真的狠无助55555谢谢大家了~!
我电脑刚刚格式化一次,格式化之前没有问题,调试狠顺畅,格完之后就这样了,软件装的都一样啊,大家这是怎么回事呢??????
我电脑刚刚格式化一次,格式化之前没有问题,调试狠顺畅,格完之后就这样了,软件装的都一样啊,大家这是怎么回事呢??????
看看配置文件中appSettings节点下定义key为time.txt的节点这个路径应该是配置在这里的
2000-11-10 0:00:00
2100-12-1 0:00:00
或者在你的项目中找找。