コード例 #1
0
ファイル: default.aspx.cs プロジェクト: RainSong/Sample
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["ServerName"] != null &&
             Session["UName"] != null &&
             Session["Upwd"] != null &&
             !string.IsNullOrEmpty(Session["UName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["ServerName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["Upwd"].ToString().Trim()))
         {
             try
             {
                 getInfos = new GetDataBasesInfo(Session["ServerName"].ToString(), Session["UName"].ToString(), Session["Upwd"].ToString());
                 bindDataToTree();
             }
             catch (Exception ex)
             {
                 Response.Write("<script>alert('" + ex.Message + "')</script>");
                 Response.Redirect("index.aspx");
             }
         }
         else
         {
             Response.Redirect("index.aspx");
         }
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["ServerName"] != null &&
             Session["UName"] != null &&
             Session["Upwd"] != null &&
             !string.IsNullOrEmpty(Session["UName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["ServerName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["Upwd"].ToString().Trim()))
         {
             try
             {
                 getInfos = new GetDataBasesInfo(Session["ServerName"].ToString(), Session["UName"].ToString(), Session["Upwd"].ToString());
                 bindDataToTree();
             }
             catch (Exception ex)
             {
                 Response.Write("<script>alert('" + ex.Message + "')</script>");
                 Response.Redirect("index.aspx");
             }
         }
         else
         {
             Response.Redirect("index.aspx");
         }
     }
 }