解决方案 »

  1.   

    form.showdialog()什么叫一闪就消失了???你的子窗体是用的showdialog()吗???
      

  2.   

    登陆成功之后 让login窗体 hide,也就是隐藏而不是关闭;修改成功  让login窗体显示。
      

  3.   

    我告诉你解决方案,楼上说不需要,这个说法错误,现在别人说要重新登陆,你就告诉他怎么实现就行了!
    首先添加一个全局的变量用来存储用户登录标记,这个很重要,因为你要重新登录,当你要重新登录时这个标记你要重置一下
    然后就是显示登录界面,这个很简单,因为你开始登录后登录界面是Hide(),而不是Close(),所以这里首先把当前窗体Close(),或是Hide(),这里关键要把用户登录标记重置,再把登录窗体.Show()就行了不过有一个更简单的方法
    Application.Restart();
    这样就重启了程序,也就是要重新登录了
      

  4.   

    这个 我试过了,确实解决了我的问题,就是我想问一下,如果我使用Application.Restart();重启程序的话,还需不需要用application.exit();来关闭进程呢
      

  5.   

    用了Application.Restart(); 就不需要用exit了。
      

  6.   

    <asp:Button ID="btnAmend" runat="server" OnClick="btnAmend_Click" Text="修改" Font-Size="9pt" Width="47px" />
    //加载显示的修改信息
      protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null && Session["PassWord"] == null)
            {
                Response.Redirect("~/BlogIndex.aspx");
            }
            if (!IsPostBack)
            {//codego.net/tags/1/1/
    SqlConnection mycon = new SqlConnection(ConfigurationManager.AppSettings["conStr"]);
                SqlDataAdapter mydataadapter = new SqlDataAdapter("select * from ST_link where ST_l_id=" + Request["id"], mycon);
    DataSet mydataset = new DataSet();
                mydataadapter.Fill(mydataset, "ST_link");
                DataRowView rowview = mydataset.Tables["ST_link"].DefaultView[0];
                this.txtName.Text = Convert.ToString(rowview["ST_l_name"]);
                this.txtUrl.Text = Convert.ToString(rowview["ST_l_url"]);
    mycon.Close();
            }
        }
    //修改完信息跳转到登录页面
    protected void btnCancle_Click(object sender, EventArgs e)
    {
    Response.Redirect("LinkManage.aspx");
    }
    protected void btnAmend_Click(object sender, EventArgs e)
    {
            string P_str_Com = "update ST_link set ST_l_name='" + this.txtName.Text + "',ST_l_url='" + this.txtUrl.Text + "' where ST_l_id='" + Request["ID"] + "'";
    SqlData da = new SqlData();
    bool add = da.ExceSQL(P_str_Com);
    if (add == true)
    {
    Response.Write("<script language=javascript>alert('修改链接成功!');location='Login.aspx'</script>");//跳转到登录页面
    }
    else
    {
    Response.Write("<script language=javascript>alert('修改链接失败!');location='javascript:history.go(-1)'</script>");//返回
    }
    }