当前位置: 首页>>代码示例>>C#>>正文


C# MySqlConnection.CancelQuery方法代码示例

本文整理汇总了C#中MySql.Data.MySqlClient.MySqlConnection.CancelQuery方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlConnection.CancelQuery方法的具体用法?C# MySqlConnection.CancelQuery怎么用?C# MySqlConnection.CancelQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MySql.Data.MySqlClient.MySqlConnection的用法示例。


在下文中一共展示了MySqlConnection.CancelQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load


//.........这里部分代码省略.........
                        else
                            LoggedInMember = new Member(BGxCookie.Values["WebSession"], Request.UserHostAddress, SqlConnection);
                    }
                    else
                        LoggedInMember = new Member(BGxCookie.Values["WebSession"], Request.UserHostAddress, SqlConnection);

                    if (Utilities.POST("Account") != "" && Utilities.POST("Password") != "" && Utilities.POST("Act") == "Login" && !LoggedInMember.IsValid)
                    {
                        if (!Member.Login(Utilities.POST("Account"), Utilities.POST("Password"), BGxCookie.Values.Get("WebSession"), Request.UserHostAddress, SqlConnection))
                            ErrorManager.Fatal("Login Failed!\r\n<a href='" + PageUri.AbsolutePath + "'>Go Back</a><script>setTimeout('location.href = \"" + PageUri.AbsolutePath + "\";', 2500);</script>", "Account: " + Utilities.POST("Account") + "<br />Hash: " + Member.HashPassword(Utilities.POST("Password")));
                        else
                        {
                            LoggedInMember.Load();
                            ErrorManager.Initialize(LoggedInMember);

                            ErrorManager.Message("Login Complete!\r\n<a href='" + PageUri.AbsolutePath + "'>Continue</a><script>setTimeout('location.href = \"" + PageUri.AbsolutePath + "\";', 2500);</script>");
                        }
                    }
                    else
                        if (Utilities.GET("Act") == "Logout")
                        {
                            BGxCookie = new System.Web.HttpCookie("BlazeGames");
                            BGxCookie.Values.Add("WebSession", Guid.NewGuid().ToString());
                            BGxCookie.Domain = ".blaze-games.com";
                            BGxCookie.Expires = DateTime.Now.AddMonths(1);
                            Response.Cookies.Add(BGxCookie);

                            ErrorManager.Initialize(new Member("", "", SqlConnection));
                            ErrorManager.Message("Logout Complete!\r\n<a href='" + PageUri.AbsolutePath + "'>Go Back</a><script>setTimeout('location.href = \"" + PageUri.AbsolutePath + "\";', 2500);</script>");
                        }
                    LoggedInMember.Load();
                    ErrorManager.Initialize(LoggedInMember);

                    Logging Log = new Logging(SqlConnection, LoggedInMember);
                    HttpHeader HttpHead = new HttpHeader();
                    Core.Events Event = new Core.Events();

                    PageSys = new DynamicPages(PageUri.AbsolutePath, SqlConnection, LoggedInMember, Log, HttpHead, Event);
                    PageSys.onPageInitialize();
                    PageSys.onPageLoad();

                    string Buffer = "";

                    if (Utilities.isMobileApps())
                        Buffer = File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/MobileApps/index.txt");
                    else if (Utilities.isMobileBrowser())
                        Buffer = File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Mobile/index.txt");
                    else
                        Buffer = File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/" + HttpHead.Theme + "/index.txt");

                    Buffer = Buffer.Replace("<!--{PageHeader}-->", HttpHead.ToString() + "\r\n<style type='text/css'>\r\n" + PageSys.CurrentPage.PageCSS + "\r\n</style>\r\n" + "<script type='text/javascript'>\r\n" + PageSys.CurrentPage.PageJS + "\r\n</script>");
                    Buffer = Buffer.Replace("<!--{PageContents}-->", PageSys.CurrentPage.PageHTML);
                    Buffer = Buffer.Replace("<!--{PageCode}-->", PageSys.onPageReturn());
                    Buffer = Buffer.Replace("<!--{WIDGET_Clock}-->", File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Default/Widgets/Clock.txt"));
                    if (LoggedInMember.IsValid)
                        Buffer = Buffer.Replace("<!--{WIDGET_Login}-->", File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Default/Widgets/Login_Member.txt"));
                    else
                        Buffer = Buffer.Replace("<!--{WIDGET_Login}-->", File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Default/Widgets/Login_Guest.txt"));
                    Buffer = Buffer.Replace("<!--{WIDGET_Social)-->", File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Default/Widgets/Social.txt"));
                    Buffer = Buffer.Replace("<!--{WIDGET_Posts}-->", File.ReadAllText(HttpContext.Current.Server.MapPath(".") + "/Themes/Default/Widgets/Posts.txt"));

                    Buffer = Buffer.Replace("<!--{Time}-->", Utilities.GetDateTime());
                    Buffer = Buffer.Replace("<!--{Nickname}-->", LoggedInMember.Nickname);
                    Buffer = Buffer.Replace("<!--{ProfileImage}-->", LoggedInMember.GetProfileImage());
                    Buffer = Buffer.Replace("<!--{Url_Secure)-->", Utilities.GetCurrentUrl(true));
                    Buffer = Buffer.Replace("<!--{PageName}-->", PageSys.PageURL);

                    foreach (string ParamKey in HttpHead.ThemeParameters.Keys)
                        Buffer = Buffer.Replace("{" + ParamKey + "}", HttpHead.ThemeParameters[ParamKey]);
                    Buffer = Buffer.Replace("{ThemePath}", "/Themes/" + HttpHead.Theme + "/");

                    DateTime stopTime = DateTime.Now;
                    TimeSpan duration = stopTime - startTime;

                    SqlConnection.CancelQuery(100);
                    SqlConnection.Close();
                    //SqlConnection.Dispose();

                    Response.Write(@"<!--

------------------------------------------
---- Blaze Games Web v5 Debug Console ----
------------------------------------------
Script Execution Time: " + duration.Milliseconds + @"MS
sqlConnection State: " + SqlConnection.State + @"

-->
");

                    Response.Write(Buffer);
                    Response.Flush();
                    Response.End();

                    PageSys.onPageUnLoad();

                    break;
                }
                catch (Exception ex) { if (i == 5) { throw ex; } continue; }
            }
        }
开发者ID:gageorsburn,项目名称:BlazeGames.Web,代码行数:101,代码来源:default.aspx.cs


注:本文中的MySql.Data.MySqlClient.MySqlConnection.CancelQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。