紧急求助!!VS出错了吗!!??帮帮忙啊!!!

qingyun27sc 2009-12-05 08:09:11
碰到的这个问题我都不知道该怎么描述了~~~~(>_<)~~~~

刚刚在用VS2008写一个程序,前一分钟调试的时候还好好的,过了一会儿再调试,就出现了个很奇怪的现象--程序都不按代码走了。。。。。。~~~~(>_<)~~~~我点击菜单的的【调试】,有两个调试选项【启动调试】和【开始执行(不调试)】,当我选择【启动调试】的时候,奇怪的事情发生了:原本程序是要弹出一个登陆窗口的,结果却并不是按代码写的进行,全乱套了;当我选择【开始执行(不调试)】的时候,VS会报错,错误详细信息如下:

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
在 landForm_GMS.MDIForm.MDIForm_Load(Object sender, EventArgs e) 位置 C:\Users\lqy\Desktop\landForm_GMS\landForm_GMS\MDIForm.cs:行号 66
在 System.Windows.Forms.Form.OnLoad(EventArgs e)
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** 已加载的程序集 **************
mscorlib
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1873 (QFEN-1.050727-1800)
基本代码: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
landForm_GMS
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///C:/Users/lqy/Desktop/landForm_GMS/landForm_GMS/bin/Debug/landForm_GMS.exe
----------------------------------------
System.Windows.Forms
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
mscorlib.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1873 (QFEN-1.050727-1800)
基本代码: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.1434 (REDBITS.050727-1400)
基本代码: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。

例如:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。


当我点击“继续(C)”的时候,VS调试的情况就会和点击【启动调试】时相同



各位大哥大姐帮帮忙,这到底是怎么一回事呀!!??

这可是我写了三个礼拜的作业呀!!!过几天就要演示了 ~~~~(>_<)~~~~ 要怎么办呀!!??




...全文
97 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingyun27sc 2009-12-05
  • 打赏
  • 举报
回复
我错了~~~谢谢大家 果然是高手 就是Lord里面NULL 我找出来了 谢谢大家的帮忙 是由于我的不小心造成的 问题出在第一句 MessageBox.Show(data.userID.ToString());


data.userID.ToString()); 是空的 。。。。 我疏忽了 没把逻辑弄严密

谢谢大家 O(∩_∩)O~
qingyun27sc 2009-12-05
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qldsrx 的回复:]
看不到代码,没法分析。可以肯定的是错误处在MDIForm_Load函数内部,请把那个函数贴出来。
[/Quote]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace landForm_GMS
{
public partial class MDIForm : Form
{
public MDIForm()
{
InitializeComponent();

}




private void 信息ToolStripMenuItem_Click(object sender, EventArgs e)
{
stuInformationViewForm f = new stuInformationViewForm();
f.MdiParent = this;
f.Show();



}

private void 成绩ToolStripMenuItem_Click(object sender, EventArgs e)
{
stuGradeViewForm f = new stuGradeViewForm();
f.MdiParent = this;
f.Show();
}

private void MDIForm_Load(object sender, EventArgs e)
{
MessageBox.Show(data.userID.ToString());

this.Hide();
landForm f=new landForm();
f.ShowDialog();
if (data.OK)
{
this.Show();
}
else
{
this.Close();
}



}

private void toolStripButton2_Click(object sender, EventArgs e)
{
viewStuForm f = new viewStuForm();
f.MdiParent = this;
f.Visible = true;
}

private void toolStripButton1_Click(object sender, EventArgs e)
{
writeGradeForm f = new writeGradeForm();
f.MdiParent = this;
f.Visible=true;
}
}
}
woshifou 2009-12-05
  • 打赏
  • 举报
回复
看看其他简单的程序可不可以用的。
wuyq11 2009-12-05
  • 打赏
  • 举报
回复
有值为 null
检查landForm_GMS.MDIForm.MDIForm_Load中代码
diandian82 2009-12-05
  • 打赏
  • 举报
回复
重启一下试试吧,怪
qldsrx 2009-12-05
  • 打赏
  • 举报
回复
看不到代码,没法分析。可以肯定的是错误处在MDIForm_Load函数内部,请把那个函数贴出来。
fengling2001 2009-12-05
  • 打赏
  • 举报
回复
clean,rebuild

在 landForm_GMS.MDIForm.MDIForm_Load(Object sender, EventArgs e) 位置 C:\Users\lqy\Desktop\landForm_GMS\landForm_GMS\MDIForm.cs:行号 66
看看附近代码

110,552

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧