小弟学习winform窗口程序,按照课本上的调试但无法成功,请大神指教一下,小弟感激不尽。。程序如下:using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;namespace 登陆
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            LoginForm frm1 =new LoginForm("CS","8888")
            if (frm1.ShowDialog() ==DialogResult.Cancel)return;
            Application.Run(new Form1());
        }
    }
}
这个是MAIN函数一下的,然后我自己建了一个Loginform的窗体,程序如下
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;namespace 登陆
{
    public partial class LoginForm : Form
    {
        private int count = 0;
        private string user, pwd;        public LoginForm(string user, string pwd)
        {
            InitializeComponent();
            this.user = user;
            this.pwd = pwd;
            button1.Click += new EventHandler(button1_Click);
        }
        void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == user && textBox2.Text == pwd)
                this.DialogResult = DialogResult.OK;
            else
            {
                MessageBox.Show("密码错误", "警告");
                if (count++ == 3)
                    this.DialogResult = DialogResult.Cancel;
            }
        }        private void LoginForm_Load(object sender, EventArgs e)
        {        }
    }
}
不知道要怎么才能把那个窗口调试出来,总是有错误谢谢指教

解决方案 »

  1.   

    Application.Run(new Form1());?????

    Application.Run(new LoginForm ());
    吧?
     
      

  2.   

    提示的错误信息是:由于缺少调试目标,无法开始调试。请生成项目并重试,或者相应的设置outputpatch和AssemblyName属性,使其指向目标程序集的正确位置。
      

  3.   

    自己看一下,是设置的问题
    http://zhangcui0311.blog.163.com/blog/static/43270001201075104653650/
      

  4.   

    然后
    右键该项目→清理,再右键该项目→重新生成。最后再调试,应该就没有问题了,Good Luck!
      

  5.   

    LS的前辈,像这种winform的程序要不要跟数据库连在一起呢?