Exemplo n.º 1
0
        /// <summary>
        /// Entry Of MongoCola@Browser
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lnkWebFormEntry_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            this.Height = 500;
            HTTP.HTTPServer.ServerPath = Application.StartupPath + "\\HTML";
            HTTP.HTTPServer svr = new HTTP.HTTPServer();
            svr.LogInfo += new EventHandler <HTTP.HTTPServer.LogOutEvent>(
                (x, y) =>
            {
                if (txtInfo.InvokeRequired)
                {
                    WriteInfo t = new WriteInfo(Write);
                    object[] o  = new object[2] {
                        y.Info, y.Level
                    };
                    ((Control)this).Invoke(t, o);
                    return;
                }
                else
                {
                    Write(y.Info, y.Level);
                }
            });
            Thread q = new Thread(new ThreadStart(svr.Start));

            q.Start();
            System.Diagnostics.Process.Start("http://localhost:13000/");
        }
Exemplo n.º 2
0
 /// <summary>
 /// Entry Of MongoCola@Browser
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lnkTryBrowse_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
 {
     this.Height = 500;
     HTTP.HTTPServer.ServerPath = Application.StartupPath + "\\HTML";
     HTTP.HTTPServer svr = new HTTP.HTTPServer();
     svr.LogInfo += new EventHandler<HTTP.HTTPServer.LogOutEvent>(
          (x, y) =>
          {
              if (txtInfo.InvokeRequired)
              {
                  WriteInfo t = new WriteInfo(Write);
                  object[] o = new object[2] { y.Info,y.Level };
                  ((Control)this).Invoke(t, o);
                  return;
              }
              else
              {
                  Write(y.Info,y.Level);
              }
          });
     Thread q = new Thread(new ThreadStart(svr.Start));
     q.Start();
     System.Diagnostics.Process.Start("http://localhost:13000/");
 }