From: <br...@us...> - 2008-06-01 11:16:16
|
Revision: 193 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=193&view=rev Author: brus07 Date: 2008-06-01 04:16:18 -0700 (Sun, 01 Jun 2008) Log Message: ----------- Added DataContainer (DataMediator) to SocketServerPlugin Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/Connector/WebConnector.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Data/DataMediator.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs ACMServer/trunk/MediatorSolution/Mediator/Mediator.csproj Removed Paths: ------------- ACMServer/trunk/MediatorSolution/Mediator/Library/Connector/ ACMServer/trunk/MediatorSolution/Mediator/Library/SocketGate.cs ACMServer/trunk/MediatorSolution/Mediator/Library/WebGate.cs Modified: ACMServer/trunk/MediatorSolution/Library/Connector/WebConnector.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/WebConnector.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Library/Connector/WebConnector.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -63,7 +63,7 @@ { using (System.IO.StreamWriter sr = new System.IO.StreamWriter("b.txt", true)) { - sr.WriteLine(message); + sr.WriteLine(DateTime.Now.ToLongTimeString() + ": " + message); } } catch (Exception) Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -59,7 +59,7 @@ private void button4_Click(object sender, EventArgs e) { - AcmContester.Mediator.Library.Data.DataMediator d = AcmContester.Mediator.Library.Data.DataMediator.GetMediator(); + //AcmContester.Mediator.Library.Data.DataMediator d = AcmContester.Mediator.Library.Data.DataMediator.GetMediator(); //d.DeleteOld(); TcpClient tcpClient = new TcpClient(); Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Data/DataMediator.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Data/DataMediator.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Data/DataMediator.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -4,26 +4,12 @@ namespace AcmContester.Mediator.Library.Data { - /// <summary> - /// Pattern: Singleton - /// </summary> class DataMediator { - static DataMediator instance = new DataMediator(); - const int secondToLive = 60; Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); - private DataMediator() - { - } - - public static DataMediator GetMediator() - { - return instance; - } - /// <summary> /// \xDF\xEA\xF9\xEE \xF1\xE0\xE1\xEC\xB3\xF2 \xF3 \xF7\xE5\xF0\xE7\xB3 \xE7\xED\xE0\xF5\xEE\xE4\xE8\xF2\xFC\xF1\xFF \xE1\xB3\xEB\xFC\xF8\xE5 \xED\xB3\xE6 secondToLive \xF1\xE5\xEA\xF3\xED\xE4, \xF2\xEE \xE2\xB3\xED \xEF\xF0\xEE\xF1\xF2\xEE \xE2\xE8\xE4\xE0\xEB\xFF\xBA\xF2\xFC\xF1\xFF \xE7 \xED\xE5\xBF /// </summary> @@ -34,7 +20,7 @@ foreach(KeyValuePair<int,DateTime> elem in d) { TimeSpan ts = now - elem.Value; - if (ts.Seconds > secondToLive) + if (ts.TotalSeconds > secondToLive) { keysToDelete.Add(elem.Key); } @@ -50,36 +36,24 @@ return d.ContainsKey(id); } - public void Add(Submit data) + public bool Add(Submit data) { + DeleteOld(); if (Contains(data.GetHashCode()) == false) { d.Add(data.GetHashCode(), DateTime.Now); - SendToTester(data); + return true; } - DeleteOld(); + return false; } public void Return(Result data) { + DeleteOld(); if (Contains(data.Submit.GetHashCode()) == true) { d.Remove(data.Submit.GetHashCode()); } - SendToWeb(data); - DeleteOld(); } - - private void SendToTester(Submit data) - { - SocketGate gate = new SocketGate(); - gate.SendToClient(data); - } - - private void SendToWeb(Result data) - { - WebGate gate = new WebGate(); - gate.SendToWeb(data); - } } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -9,7 +9,7 @@ public abstract void Send(string message); - protected void DataArrived(string message) + protected virtual void DataArrived(string message) { if (onDataArrived != null) onDataArrived(message); Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -1,14 +1,19 @@ using System; using AcmContester.Mediator.Library.Plugins; using AcmContester.Library.Connector; +using AcmContester.Mediator.Library.Data; namespace AcmContester.Mediator.Library.Plugins.SocketGate { + /// <summary> + /// Pattern: Singleton + /// </summary> class SocketServerPlugin : BaseMediatorPlugin { private static SocketServerPlugin instance = new SocketServerPlugin(); private SocketServer server = new SocketServer(); + private DataMediator dataContainer = new DataMediator(); private SocketServerPlugin() { @@ -23,9 +28,16 @@ public override void Send(string message) { - server.Send(message); + if (dataContainer.Add(new Submit(message))) + server.Send(message); } + protected override void DataArrived(string message) + { + dataContainer.Return(new Result(message)); + base.DataArrived(message); + } + internal int CountClients() { return server.CountClients(); Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -4,6 +4,9 @@ namespace AcmContester.Mediator.Library.Plugins.WebGate { + /// <summary> + /// Pattern: Singleton + /// </summary> class WebGatePlugin: BaseMediatorPlugin { private static WebGatePlugin instance = new WebGatePlugin(); Deleted: ACMServer/trunk/MediatorSolution/Mediator/Library/SocketGate.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/SocketGate.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/SocketGate.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -1,31 +0,0 @@ -using System; -using AcmContester.Library.Connector; -using AcmContester.AcmLibraryExtention; -using AcmContester.Mediator.Library.Data; -using AcmContester.Mediator.Library.Connector; - -namespace AcmContester.Mediator.Library -{ - class SocketGate - { - SocketServerSingleton server = SocketServerSingleton.GetServer(); - - DataMediator mediator = DataMediator.GetMediator(); - - public SocketGate() - { - server.onDataArrived += DataArrived; - } - - public void SendToClient(Submit data) - { - server.Send(data.ToString()); - } - - private void DataArrived(string message) - { - //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE7\xF0\xEE\xE1\xE8\xF2\xE8 \xEF\xE5\xF0\xE5\xE2\xB3\xF0\xEA\xF3 \xF9\xEE \xF1\xE0\xEC\xE5 \xEF\xF0\xE8\xE9\xEC\xE0\xBA\xF2\xFC\xF1\xFF \xE2\xB3\xE4 Socket'\xE0, \xE1\xEE \xEC\xEE\xE6\xE5 \xE1\xF3\xF2\xE8 \xED\xE5 \xF2\xB3\xEB\xFC\xEA\xE8 Result - mediator.Return(new Result(message)); - } - } -} Deleted: ACMServer/trunk/MediatorSolution/Mediator/Library/WebGate.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/WebGate.cs 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/WebGate.cs 2008-06-01 11:16:18 UTC (rev 193) @@ -1,29 +0,0 @@ -using System; -using AcmContester.Mediator.Library.Data; -using AcmContester.Mediator.Library.Connector; - -namespace AcmContester.Mediator.Library -{ - class WebGate - { - WebConnectorSingleton webConnector = WebConnectorSingleton.GetWebConnector(); - - DataMediator mediator = DataMediator.GetMediator(); - - public WebGate() - { - webConnector.onDataArrived += DataArrived; - } - - public void SendToWeb(Result data) - { - webConnector.Send(data.ToString()); - } - - private void DataArrived(string message) - { - //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE7\xF0\xEE\xE1\xE8\xF2\xE8 \xEF\xE5\xF0\xE5\xE2\xB3\xF0\xEA\xF3 \xF9\xEE \xF1\xE0\xEC\xE5 \xEF\xF0\xE8\xE9\xEC\xE0\xBA\xF2\xFC\xF1\xFF \xE2\xB3\xE4 Web'\xE0, \xE1\xEE \xEC\xEE\xE6\xE5 \xE1\xF3\xF2\xE8 \xED\xE5 \xF2\xB3\xEB\xFC\xEA\xE8 Submit. \xD2\xE0\xEA\xEE\xE6 \xEC\xEE\xE6\xE5 \xE1\xF3\xF2\xE8 \xE4\xE5\xEA\xB3\xEB\xFC\xEA\xE0 Submit'\xB3\xE2 - mediator.Add(new Submit(message)); - } - } -} Modified: ACMServer/trunk/MediatorSolution/Mediator/Mediator.csproj =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Mediator.csproj 2008-05-31 14:05:42 UTC (rev 192) +++ ACMServer/trunk/MediatorSolution/Mediator/Mediator.csproj 2008-06-01 11:16:18 UTC (rev 193) @@ -42,8 +42,6 @@ <Compile Include="Form1.Designer.cs"> <DependentUpon>Form1.cs</DependentUpon> </Compile> - <Compile Include="Library\Connector\SocketServerSingleton.cs" /> - <Compile Include="Library\Connector\WebConnectorSignleton.cs" /> <Compile Include="Library\Data\DataMediator.cs" /> <Compile Include="Library\Data\Result.cs" /> <Compile Include="Library\Data\Submit.cs" /> @@ -53,8 +51,6 @@ <Compile Include="Library\Plugins\SocketGate\SocketServerPlugin.cs" /> <Compile Include="Library\Plugins\WebGate\CreaterMediatorPlugin.cs" /> <Compile Include="Library\Plugins\WebGate\WebGatePlugin.cs" /> - <Compile Include="Library\SocketGate.cs" /> - <Compile Include="Library\WebGate.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <EmbeddedResource Include="Form1.resx"> @@ -91,6 +87,9 @@ <Name>LibraryExtention</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Folder Include="Library\Connector\" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-04 12:57:33
|
Revision: 211 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=211&view=rev Author: brus07 Date: 2008-06-04 05:57:22 -0700 (Wed, 04 Jun 2008) Log Message: ----------- Update protocol (change separator character to '$'). Fixed bug with empty response. Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs Modified: ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-04 09:08:29 UTC (rev 210) +++ ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-04 12:57:22 UTC (rev 211) @@ -45,8 +45,8 @@ void Send2(string message) { - string res = (message.Split(' '))[0]; - string id = (message.Split(' '))[1]; + string res = (message.Split('$'))[0]; + string id = (message.Split('$'))[1]; HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://127.0.0.1/d/set.php?res=" + res + "&id=" + id); myRequest.Method = "GET"; myRequest.GetResponse(); @@ -67,6 +67,8 @@ string result = sr.ReadToEnd(); sr.Close(); myResponse.Close(); + if (result.Length == 0) + return null; return result; } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs 2008-06-04 09:08:29 UTC (rev 210) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Result.cs 2008-06-04 12:57:22 UTC (rev 211) @@ -14,11 +14,9 @@ public Result(string message) { //TODO - string[] messages = message.Split(' '); - if (messages.Length != 3) - throw new Exception("Result.Result: \xED\xE5\xEF\xF0\xE0\xE2\xE8\xEB\xFC\xED\xE8\xE9 \xF4\xEE\xF0\xEC\xE0\xF2 \xE2\xF5\xB3\xE4\xED\xEE\xBF \xF1\xF2\xF0\xB3\xF7\xEA\xE8"); - temp = messages[0]; - submit = new Submit(messages[1] + " " + messages[2]); + temp = message.Substring(0, message.IndexOf('$')); + string s = message.Substring(message.IndexOf('$') + 1); + submit = new Submit(s); } public Submit Submit Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs 2008-06-04 09:08:29 UTC (rev 210) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Data/Submit.cs 2008-06-04 12:57:22 UTC (rev 211) @@ -13,11 +13,8 @@ public Submit(string message) { //TODO - string[] messages = message.Split(' '); - if (messages.Length != 2) - throw new Exception("Submit.Submit: \xED\xE5\xEF\xF0\xE0\xE2\xE8\xEB\xFC\xED\xE8\xE9 \xF4\xEE\xF0\xEC\xE0\xF2 \xE2\xF5\xB3\xE4\xED\xEE\xBF \xF1\xF2\xF0\xB3\xF7\xEA\xE8"); - id = Convert.ToInt32(messages[0]); - temp = messages[1]; + id = Convert.ToInt32(message.Substring(0,message.IndexOf('$'))); + temp = message.Substring(message.IndexOf('$')+1); } //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-05 20:30:36
|
Revision: 219 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=219&view=rev Author: brus07 Date: 2008-06-05 13:30:40 -0700 (Thu, 05 Jun 2008) Log Message: ----------- Rename InDataW.txt file. Start all work when start application. Not use GUI element marked as Enabled=false. Fixed bug with send to web result in WebGetter. Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/Connector/Connector.csproj ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.cs Added Paths: ----------- ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt Removed Paths: ------------- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/InData.txt Modified: ACMServer/trunk/MediatorSolution/Library/Connector/Connector.csproj =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/Connector.csproj 2008-06-05 20:27:25 UTC (rev 218) +++ ACMServer/trunk/MediatorSolution/Library/Connector/Connector.csproj 2008-06-05 20:30:40 UTC (rev 219) @@ -47,7 +47,7 @@ <Compile Include="WebConnector.cs" /> </ItemGroup> <ItemGroup> - <Content Include="Getter\InData.txt"> + <Content Include="InDataW.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> Deleted: ACMServer/trunk/MediatorSolution/Library/Connector/Getter/InData.txt =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/InData.txt 2008-06-05 20:27:25 UTC (rev 218) +++ ACMServer/trunk/MediatorSolution/Library/Connector/Getter/InData.txt 2008-06-05 20:30:40 UTC (rev 219) @@ -1,2 +0,0 @@ -http://127.0.0.1/d -http://acm.lviv.ua/version3 \ No newline at end of file Modified: ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-05 20:27:25 UTC (rev 218) +++ ACMServer/trunk/MediatorSolution/Library/Connector/Getter/WebGetter.cs 2008-06-05 20:30:40 UTC (rev 219) @@ -16,7 +16,7 @@ { if (fullPathToWebPages == "") { - StreamReader s = new StreamReader("Getter/InData.txt", Encoding.Default); + StreamReader s = new StreamReader("InDataW.txt", Encoding.Default); fullPathToWebPages = s.ReadLine(); s.Close(); } @@ -65,14 +65,8 @@ string id = (message.Split('$'))[1]; HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(fullPathToWebPages + "/set.php?res=" + res + "&id=" + id); myRequest.Method = "GET"; - myRequest.GetResponse(); - /* WebResponse myResponse = myRequest.GetResponse(); - StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); - string result = sr.ReadToEnd(); - sr.Close(); myResponse.Close(); - */ } string GetInfoFromSite2() { @@ -80,9 +74,9 @@ myRequest.Method = "GET"; WebResponse myResponse = myRequest.GetResponse(); StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); + myResponse.Close(); string result = sr.ReadToEnd(); sr.Close(); - myResponse.Close(); if (result.Length == 0) return null; return result; Added: ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt (rev 0) +++ ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt 2008-06-05 20:30:40 UTC (rev 219) @@ -0,0 +1,2 @@ +http://acm.lviv.ua/version3 +http://127.0.0.1/d \ No newline at end of file Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs 2008-06-05 20:27:25 UTC (rev 218) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs 2008-06-05 20:30:40 UTC (rev 219) @@ -35,11 +35,14 @@ this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.timer1 = new System.Windows.Forms.Timer(this.components); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // button2 // + this.button2.Enabled = false; this.button2.Location = new System.Drawing.Point(12, 12); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); @@ -51,7 +54,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 76); + this.label1.Location = new System.Drawing.Point(12, 72); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(23, 13); this.label1.TabIndex = 3; @@ -59,6 +62,7 @@ // // button3 // + this.button3.Enabled = false; this.button3.Location = new System.Drawing.Point(12, 41); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 23); @@ -88,17 +92,37 @@ this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 95); + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(236, 20); + this.textBox1.TabIndex = 10; + this.textBox1.Text = "http://acm.lviv.ua/version3/table.php"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(41, 69); + this.textBox2.Name = "textBox2"; + this.textBox2.ReadOnly = true; + this.textBox2.Size = new System.Drawing.Size(110, 20); + this.textBox2.TabIndex = 11; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(262, 160); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.button3); this.Controls.Add(this.label1); this.Controls.Add(this.button2); this.Name = "Form1"; this.Text = "Gate"; + this.Load += new System.EventHandler(this.Form1_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); @@ -115,6 +139,8 @@ private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-05 20:27:25 UTC (rev 218) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-05 20:30:40 UTC (rev 219) @@ -19,7 +19,7 @@ { InitializeComponent(); string s = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName())[0].ToString(); - label1.Text += s; + textBox2.Text = s; } private void button2_Click(object sender, EventArgs e) @@ -57,5 +57,10 @@ mes += "0"; toolStripStatusLabel1.Text = mes; } + + private void Form1_Load(object sender, EventArgs e) + { + button2_Click(this, null); + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |