private void Setup_Load(object sender, EventArgs e) { Size = new Size(350, 255); /*SqlDataSourceEnumerator instance = SqlDataSourceEnumerator.Instance; * System.Data.DataTable table = instance.GetDataSources(); * * foreach (System.Data.DataRow row in table.Rows) * { * string serverName = ""; * string instanceName = ""; * foreach (System.Data.DataColumn col in table.Columns) * { * if (col.ColumnName == "ServerName") serverName = row[col].ToString(); * else if (col.ColumnName == "InstanceName") instanceName = row[col].ToString(); * } * * if (serverName != "" && instanceName != "") * { * SERVER.SetDataStr(serverName + "\\" + instanceName); * break; * } * }*/ SERVER.Focus(); }
private void BtnKaydet_Click(object sender, EventArgs e) { if (pnlSetup.CanNullsCheck()) { ArsLibrary.SaveLineCFG("DBServerName", SERVER.GetDataStr()); ArsLibrary.SaveLineCFG("DBUserName", DB_KULLANICI_ADI.GetDataStr()); ArsLibrary.SaveLineCFG("DBPassword", DB_SIFRE.GetDataStr()); ArsLibrary.SaveLineCFG("DBName", "master"); ArsLibrary.dbServerName = SERVER.GetDataStr(); ArsLibrary.dbUserName = DB_KULLANICI_ADI.GetDataStr(); ArsLibrary.dbPassword = DB_SIFRE.GetDataStr(); ArsLibrary.dbName = "master"; ArsMessage.ShowMessage("Bilgi", "Kayıt Tamamlandı"); if (girisForm != null) { girisForm.Size = new Size(480, 300); } Close(); } else { ArsMessage.ShowMessage("Hata", "Lütfen veritabanı Bağlantısı İçin Gerekli Bilgileri Doldurunuz."); } }
static void Main(string[] args) { Console.CursorVisible = false; Console.Title = "Chatting Server"; Console.CancelKeyPress += Console_CancelKeyPress; Console.WriteLine("Exit by Ctrl-C"); SERVER.begin(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static void testNoJettyVersionInResponseHeaders(java.net.URI baseUri) throws Exception private static void TestNoJettyVersionInResponseHeaders(URI baseUri) { IDictionary <string, IList <string> > headers = RunRequestAndGetHeaders(baseUri); assertNull(headers[SERVER.asString()]); // no 'Server' header foreach (IList <string> values in headers.Values) { assertFalse(values.Any(value => value.ToLower().Contains("jetty"))); // no 'jetty' in other header values } }
static void Main() { //SetProcessAffinityMask(GetCurrentProcess(), 0x0001); //new DetergentVolService().UpdateDetergentUsingFinishingTime(DateTime.Now); TcpServer = new SERVER(); TcpServer.AnalyeEvent += new SERVER.SERVERHandler(OnServerAnalyeEvent); TcpServer.AnalyeConnectedEvent += new SERVER.SERVERHandler(OnTcpServerAnalyeConnectedEvent); TcpServer.SetupService(); Analyzer = new Machine(); Analyzer.MachineState.MachineStateChangedEvent += new MachineState.MachineStateHandler(OnMachineStateChangedEvent); }
public void runner() { BinaryReader r = new BinaryReader(new NetworkStream(s)); BinaryWriter w = new BinaryWriter(new NetworkStream(s)); try { while (true) { int type = r.ReadInt32(); string name = r.ReadString(); string pass = r.ReadString(); if (type == 0) { u = SERVER.signup(name, pass); Console.WriteLine((s.RemoteEndPoint as IPEndPoint).Address + " has registered as " + u.getName() + "."); if (u == null) { w.Write(false); } else { w.Write(true); } } else if (type == 1) { u = SERVER.login(name, pass, s); if (u == null) { w.Write(false); } else { w.Write(true); u.setWriter(w); SERVER.updateList(); break; } } } int junk = r.ReadInt32();//For detecting Closing the connection. } catch (Exception e) { if (u != null) { Console.WriteLine(u.getName() + " has diconnected."); } SERVER.remove(u); s.Close(); } }
static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e) { SERVER.end(); }