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


C# TcpClient.smethod_7方法代码示例

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


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

示例1: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     this.button1.Enabled = false;
     try
     {
         TcpClient tcpClient = new TcpClient();
         this.labelActivationStatus.Text = "Connecting...";
         if (!tcpClient.smethod_7(this.string_0, 2798, 5000))
         {
             throw new Exception("Could not connect to server");
         }
         NetworkStream stream = tcpClient.GetStream();
         stream.smethod_3(this.textBox1.Text.Trim());
         int num = stream.smethod_4();
         stream.Close();
         if (num == 1)
         {
             MessageBox.Show("Key activation successful!\r\nYou can use that key to login now.", "Success", MessageBoxButtons.OK, MessageBoxIcon.None);
             base.Close();
             return;
         }
         this.labelActivationStatus.Text = "";
         MessageBox.Show("This key already active or invalid!!\r\n\r\nYou only have to activate the key once.\r\nThen you can login with it", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     catch (Exception ex)
     {
         this.labelActivationStatus.Text = "Error: " + ex.Message;
     }
     this.button1.Enabled = true;
 }
开发者ID:JohnDeerexx,项目名称:project-respawn,代码行数:30,代码来源:ActivateKeyDialog.cs

示例2: smethod_1

 private static void smethod_1()
 {
     if (!Class92.AuthenticationFaulted)
     {
         string text = Class91.smethod_2("SessionHost");
         string text2 = Class91.smethod_2("SessionPort");
         string text3 = Class91.smethod_2("SessionID");
         if (string.IsNullOrWhiteSpace(text) || string.IsNullOrWhiteSpace(text2) || string.IsNullOrWhiteSpace(text3))
         {
             Class92.AuthenticationFaulted = true;
         }
         else
         {
             text = text.Replace("\r", "").Replace("\n", "");
             text2 = text2.Replace("\r", "").Replace("\n", "");
             text3 = text3.Replace("\r", "").Replace("\n", "");
             int int_ = 0;
             if (!int.TryParse(text2, out int_))
             {
                 Class92.AuthenticationFaulted = true;
             }
             else
             {
                 TcpClient tcpClient = new TcpClient();
                 tcpClient.ReceiveTimeout = 10000;
                 tcpClient.SendTimeout = 10000;
                 try
                 {
                     if (!tcpClient.smethod_7(text, int_, 10000))
                     {
                         Class92.dateTime_0 = DateTime.Now + Class92.timeSpan_0;
                     }
                     else
                     {
                         NetworkStream stream = tcpClient.GetStream();
                         if (!Class92.FirstTimeAuthDone)
                         {
                             stream.smethod_5(0);
                         }
                         else
                         {
                             stream.smethod_5(1);
                         }
                         stream.smethod_3(text3);
                         stream.smethod_5(Process.GetCurrentProcess().Id);
                         int num = stream.smethod_4();
                         if (num == 0)
                         {
                             Class92.AuthenticationFaulted = true;
                         }
                         else
                         {
                             if (num == 1)
                             {
                                 Class92.FirstTimeAuthDone = true;
                                 Class92.LastAuth = DateTime.Now;
                                 Class92.dateTime_0 = DateTime.Now + Class92.timeSpan_1;
                             }
                         }
                     }
                 }
                 finally
                 {
                     tcpClient.Close();
                 }
             }
         }
     }
 }
开发者ID:JohnDeerexx,项目名称:project-respawn,代码行数:69,代码来源:Class92.cs

示例3: method_6

 private void method_6()
 {
     int num = 2797;
     string text = Class4.smethod_2("SessionID");
     DateTime now = DateTime.Now;
     while (true)
     {
         try
         {
             TcpClient tcpClient = new TcpClient();
       if (tcpClient.smethod_7("1", num, 10000))// if (tcpClient.smethod_7("193.192.58.73", num, 10000))
             {
                 NetworkStream stream = tcpClient.GetStream();
                 stream.smethod_5(2);
                 stream.smethod_3(text);
                 int num2 = stream.smethod_4();
                 stream.Close();
                 if (num2 != 1)
                 {
                     break;
                 }
                 now = DateTime.Now;
                 Thread.Sleep(TimeSpan.FromMinutes(2.0));
             }
             goto IL_AB;
         }
         catch (Exception ex)
         {
             MessageBox.Show("Auth error: " + ex.Message, "error");
             goto IL_AB;
         }
         IL_9C:
         Thread.Sleep(5000);
         continue;
         IL_AB:
         if (DateTime.Now - now > TimeSpan.FromMinutes(10.0))
         {
             break;
         }
         goto IL_9C;
     }
     base.BeginInvoke(new MethodInvoker(this.method_7));
     TaskFactory arg_100_0 = Task.Factory;
     if (ProfileManager.action_0 == null)
     {
         ProfileManager.action_0 = new Action(ProfileManager.smethod_2);
     }
     arg_100_0.StartNew(ProfileManager.action_0);
 }
开发者ID:JohnDeerexx,项目名称:project-respawn,代码行数:49,代码来源:ProfileManager.cs


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