0

我有一个小问题,这让我现在很生气。我的代码中有一个小错误,然后我发现了错误并且一切运行良好 - 几乎。我必须在解决方案中找到文件的路径,现在我找到了。但是如果我打开表单的设计,它会给我错误

“找不到路径 'C:\Windows\system32\Source\ChampsList.txt' 的一部分”

就行了,应该是哪里出了问题,什么都没有。我可以忽略这个问题,一切都运行良好。但是,我仍然讨厌这个:

这个

谢谢

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(1083, 569);
        this.Controls.Add(this.guides1);
        this.Controls.Add(this.MainMenu); // this is line where "is" mistake
        this.Controls.Add(this.Panels);
        this.Controls.Add(this.Strip);
        this.MainMenuStrip = this.MainMenu;
        this.Name = "MainProgram";
        this.Text = "Porgram";
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
        this.Load += new System.EventHandler(this.AppLoad);
        this.MainMenu.ResumeLayout(false);
        this.MainMenu.PerformLayout();
        this.Strip.ResumeLayout(false);
        this.Strip.PerformLayout();
        this.Panels.ResumeLayout(false);
        this.ResumeLayout(false);
        this.PerformLayout();

调用堆栈:

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, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
at System.IO.File.ReadAllText(String path)
at HelpApp.Guides.Guides_Load(Object sender, EventArgs e) in c:\Users\Lukáš\Documents\Visual Studio 2010\Projects\HelpApp\HelpApp\Guides.cs:line 28
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c) 
4

0 回答 0