예제 #1
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         InitialNetworkInterfaces();
         //添加二维码控件
         qrcodeControl          = new Smobiler.Utility.Encoding.Windows.Forms.QrCodeImgControl();
         qrcodeControl.Location = new System.Drawing.Point(21, 120);
         qrcodeControl.Name     = "PictureBox1";
         qrcodeControl.Size     = new System.Drawing.Size(306, 306);
         qrcodeControl.TabIndex = 7;
         qrcodeControl.TabStop  = false;
         this.Controls.Add(qrcodeControl);
         //定义Smobiler服务
         server = new Smobiler.Core.MobileServer();
         //设置默认网卡
         if (networkDict.Count > 0)
         {
             string[] combvalues = new string[networkDict.Count];
             networkDict.Keys.CopyTo(combvalues, 0);
             this.combNets.Items.AddRange(combvalues);
             this.combNets.SelectedIndex = 0;
         }
         //启动Smobiler服务
         StartServer();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Application.Exit();
     }
 }
예제 #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         InitialNetworkInterfaces();
         //定义Smobiler服务
         server = new Smobiler.Core.MobileServer();
         server.SessionStart += new Smobiler.Core.SmobilerSessionEventHandler(this.server_SessionStart);
         //设置默认网卡
         if (networkDict.Count > 0)
         {
             string[] combvalues = new string[networkDict.Count];
             networkDict.Keys.CopyTo(combvalues, 0);
             this.combNets.Items.AddRange(combvalues);
             this.combNets.SelectedIndex = 0;
         }
         //模拟Framework初始化代码
         InitFramework();
         //启动Smobiler服务
         StartServer();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Application.Exit();
     }
 }