Example #1
0
        static void Main(string[] args)
        {
            websocket w = new websocket();

            w.CreateUniqueSession();
            Console.ReadLine();
        }
Example #2
0
File: Form1.cs Project: mabeyu/CEF
 private void OpenOrderUI(int s)
 {
     try
     {
         UpLoad upload = new UpLoad(mWebsocket);
         if (Form1.dic_upLoad.Count > 0)
         {
             foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除
             {
                 kv.Value.Close();
                 kv.Value.Dispose();
                 websocket w = new websocket();
                 UpLoad    u = new UpLoad(w);
                 Form1.dic_upLoad.TryRemove(kv.Key, out u);
             }
         }
         string str = "";
         Form1.dic_upLoad.TryAdd(str, upload);
         upload.Show();
     }
     catch (Exception ex)
     {
         IniHelper.WriteLog(ex);
         return;
     }
 }
Example #3
0
 public thread_fsw2(string type, string path, websocket mWebsocket)
 {
     this.path       = path;
     this.type       = type;
     this.mWebsocket = mWebsocket;
     mIni            = new IniHelper();
     mIni.ImportHelper(System.Environment.CurrentDirectory + "\\Param.ini");
 }
Example #4
0
File: UpLoad.cs Project: mabeyu/CEF
 public UpLoad(websocket mWebsocket)
 {
     InitializeComponent();
     dt1             = new DataTable();
     dt2             = new DataTable();
     this.mWebsocket = mWebsocket;
     mIni.ImportHelper(System.Environment.CurrentDirectory + "\\Param.ini");
 }
Example #5
0
 public RAM()
 {
     InitializeComponent();
     w = new websocket("localhost", "12001");
     w.CreateUniqueSession();
     System.Threading.Thread.Sleep(2000);
     w.RAMData += w_RAMData;
 }
Example #6
0
File: Form1.cs Project: mabeyu/CEF
        /// <summary>
        /// 打开订单新窗口
        /// </summary>
        /// <param name="orderid"></param>
        private void OpenUpload(string orderid)
        {
            UpLoad upload = new UpLoad(mWebsocket);

            if (Form1.dic_upLoad.Count > 0)
            {
                foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除
                {
                    kv.Value.Close();
                    kv.Value.Dispose();
                    websocket w = new websocket();
                    UpLoad    u = new UpLoad(w);
                    Form1.dic_upLoad.TryRemove(kv.Key, out u);
                }
            }
            Form1.dic_upLoad.TryAdd(orderid, upload);
            upload.Show();
        }
Example #7
0
File: Form1.cs Project: mabeyu/CEF
 /// <summary>
 /// F5刷新网页
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void gHook_KeyDown(object sender, KeyEventArgs e)
 {
     if (this.ContainsFocus)
     {
         if (e.KeyValue == 116)
         {
             wb.GetBrowser().Reload();
         }
         else if (e.KeyValue == 117)
         {
             try
             {
                 UpLoad upload = new UpLoad(mWebsocket);
                 if (Form1.dic_upLoad.Count > 0)
                 {
                     foreach (KeyValuePair <string, UpLoad> kv in Form1.dic_upLoad)//关闭其他窗口并移除
                     {
                         kv.Value.Close();
                         kv.Value.Dispose();
                         websocket w = new websocket();
                         UpLoad    u = new UpLoad(w);
                         Form1.dic_upLoad.TryRemove(kv.Key, out u);
                     }
                 }
                 string str = "";
                 Form1.dic_upLoad.TryAdd(str, upload);
                 upload.Show();
             }
             catch (Exception ex)
             {
                 IniHelper.WriteLog(ex);
                 return;
             }
         }
     }
 }
Example #8
0
        //Start Monitoring
        private void btnStart_Click(object sender, EventArgs e)
        {
            w = new websocket("localhost", "12001");
            w.CreateUniqueSession();
            System.Threading.Thread.Sleep(2000);
            w.DiskData += w_DiskData;
            getDiskData();
            //perfCountObj = new PerfCounterHD(Environment.MachineName);
            //perfCountObj = new PerfCounterHD(hostListComboBox.SelectedItem.ToString());
            //diskDataValues.HostName = hostListComboBox.SelectedItem.ToString();
            btnStop.Enabled  = true;
            btnStart.Enabled = false;

            lblTransMax.Text = "0.0";

            stopwatch.Start(); // ready the clock

            this.enableButtons(true);

            timer = new Timer {
                Enabled = true, Interval = 1000
            };
            timer.Tick += t_Tick;
        }
Example #9
0
 public check_thread(string dir, string type, websocket mWebsocket)
 {
     this.dir        = dir;
     this.type       = type;
     this.mWebsocket = mWebsocket;
 }
Example #10
0
 public ConnectToClient()
 {
     InitializeComponent();
     client = new websocket("localhost", "12001");
 }