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. |