how to watch if the packets are being transmitted or received?
supercsharp1
Posts
-
How to know if the mobile is downloading or uploading data from internet? -
How to know if the mobile is downloading or uploading data from internet?I am developing a program running on mobilephone using c# 2005,when my program is running,I need to know if the mobilephone is downloading or uploading data from internet online,how to do it?
-
How To test Mobile Signal in Windows Mobile 5.0 program using C#?I develop a mobile telephone program using c#,I need to test if the mobile signal is working or in good state,how to deal with it?
-
How to grow to be top programmer in c#?I am new in c# programming,i want to improve my programming ability,how?
-
I set the Anthor property of a control,why it not work?Hello! Thank you very much for looking at and answer my questions. I develope mobile phone program using c# 2005,I set the anthor property of a datagrid control,but it does not work.I don't why,maybe it have something to do with my program achitecture.Because all my control is added according to a text file,which decide what kind of control to add and their property value,my program read this text file,and add control dynamicly. Thanks for answering.
-
the quesion about Timer:it is Started but does not run the funtion every minute?I hava a page,named TaskConf,there is a System.Windows.Forms.Timer timer1,and there is a funtion named SetTmier() to Start timer1 public void SetTimer() { timer1.interval = 60000; timer1.Ticked += new EventHandler(Task_refrush); timer1.Enable = true; } The funtion Task_refrush is the event funtion,which is belong to page TaskConf. In the other page login I call TaskConf Constructor,and then Start two thread to Start SetTimer and Task_refrush which ara belong to TaskConf: TaskConf tc = new TaskConf(); . . . .. ... Thread t1 =new Thread(new ThreadStart(tc.Task_refrush)); t1.Start(); Thread t2 = new Thread(new ThreadStart(tc.SetTimer)); t2.Start(); I found these two threads are all running,The code in Task_refrush and SetTimer is excuted,(TaskConf is not open,but constructed,only the page login is open),the timer1 in TaskConf is started,but why the timer1 does not run the funcion Task_refrush every minute?Why?
-
problem of reading from serial portThanks for answer my question!But the problem is not what you said,I send "at e0\r",and then I send "at\r",but the message I receive from the SerialPort is "at e0\rat\r",that's very curious!Waiting for you reply!Thanks you very much!
-
problem of reading from serial portin my C# program(I mainliy use SerialPort class),I input "at" in a textBox,then the program send "at" to serial port(the other end of serial port is a modem which is connected to my computer by a data line),but when i click receive button,the message I receive from serial port is the same as what I input,namely "at",not "ok",why?who can answer my question?How I solve this problem and get the right response "ok" from serial port? next is my code: public partial class Form1 : Form { private SerialPort sp = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { sp = new SerialPort("COM1"); sp.ReadTimeout = 5000; sp.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button2_Click(object sender, EventArgs e) { try { sp.Write(textBox1.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button3_Click(object sender, EventArgs e) { try { /*string text=null; char[] buffer = new char[10]; sp.Read(buffer,0,6); for (int i = 0; i < buffer.Length; i++) { text += buffer[i]; } textBox2.Text = text;*/ /*string text = null; char t = (char)sp.ReadChar(); text+=t.ToString(); while (true) { t = (char)sp.ReadChar(); if (t == '\0') break; else text += t.ToString(); } textBox2.Text = text;*/ string text = null; byte[] t = new byte[20]; char[] c = new char[20]; sp.Read(t, 0, t.Length); sp.Read(t, 0, t.Length); c = Encoding.ASCII.GetChars(t); int i; for (i = 0; i < c.Length; i++) { if (c[i] == 'O' || c[i] == 'K') text += c[i].ToString(); } textBox2.Text = text; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
-
reading problem from serial port(use serialport class)in my C# program(I mainliy use SerialPort class),I input "at" in a textBox,then the program send "at" to serial port(the other end of serial port is a modem which is connected to my computer by a data line),but when i click receive button,the message I receive from serial port is the same as what I input,namely "at",not "ok",why?who can answer my question?How I solve this problem and get the right response "ok" from serial port? next is my code: public partial class Form1 : Form { private SerialPort sp = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { sp = new SerialPort("COM1"); sp.ReadTimeout = 5000; sp.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button2_Click(object sender, EventArgs e) { try { sp.Write(textBox1.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button3_Click(object sender, EventArgs e) { try { /*string text=null; char[] buffer = new char[10]; sp.Read(buffer,0,6); for (int i = 0; i < buffer.Length; i++) { text += buffer[i]; } textBox2.Text = text;*/ /*string text = null; char t = (char)sp.ReadChar(); text+=t.ToString(); while (true) { t = (char)sp.ReadChar(); if (t == '\0') break; else text += t.ToString(); } textBox2.Text = text;*/ string text = null; byte[] t = new byte[20]; char[] c = new char[20]; sp.Read(t, 0, t.Length); sp.Read(t, 0, t.Length); c = Encoding.ASCII.GetChars(t); int i; for (i = 0; i < c.Length; i++) { if (c[i] == 'O' || c[i] == 'K') text += c[i].ToString(); } textBox2.Text = text; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
-
read from serialport problemin my C# program,i input "at" in a textBox,then the program send "at" to serialport,but when i click receive button,the message I receive from serial port is the same as what I input,namely "at",not "ok",why?who can answer my question?How I solve this problem and get the right response "ok" from serial port? next is my code: public partial class Form1 : Form { private SerialPort sp = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { sp = new SerialPort("COM1"); sp.ReadTimeout = 5000; sp.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button2_Click(object sender, EventArgs e) { try { sp.Write(textBox1.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button3_Click(object sender, EventArgs e) { try { /*string text=null; char[] buffer = new char[10]; sp.Read(buffer,0,6); for (int i = 0; i < buffer.Length; i++) { text += buffer[i]; } textBox2.Text = text;*/ /*string text = null; char t = (char)sp.ReadChar(); text+=t.ToString(); while (true) { t = (char)sp.ReadChar(); if (t == '\0') break; else text += t.ToString(); } textBox2.Text = text;*/ string text = null; byte[] t = new byte[20]; char[] c = new char[20]; sp.Read(t, 0, t.Length); sp.Read(t, 0, t.Length); c = Encoding.ASCII.GetChars(t); int i; for (i = 0; i < c.Length; i++) { if (c[i] == 'O' || c[i] == 'K') text += c[i].ToString(); } textBox2.Text = text; } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
-
while i input "at" to serialport in my program,but return "at" not as excepted "ok"?in my C# program,i input "at" in a textBox,then the program send "at" to serialport,but when i click receive button,the message I receive from serial port is the same as I input,namely "at",not "ok",why?who can answer my question?How I solve this problem and get the right response "ok" from serial port? next is my code: public partial class Form1 : Form { private SerialPort sp = null; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { sp = new SerialPort("COM1"); sp.ReadTimeout = 5000; sp.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button2_Click(object sender, EventArgs e) { try { sp.Write(textBox1.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void button3_Click(object sender, EventArgs e) { try { /*string text=null; char[] buffer = new char[10]; sp.Read(buffer,0,6); for (int i = 0; i < buffer.Length; i++) { text += buffer[i]; } textBox2.Text = text;*/ /*string text = null; char t = (char)sp.ReadChar(); text+=t.ToString(); while (true) { t = (char)sp.ReadChar(); if (t == '\0') break; else text += t.ToString(); } textBox2.Text = text;*/ string text = null; byte[] t = new byte[20]; char[] c = new char[20]; sp.Read(t, 0, t.Length); sp.Read(t, 0, t.Length); c = Encoding.ASCII.GetChars(t); int i; for (i = 0; i < c.Length; i++) { if (c[i] == 'O' || c[i] == 'K') text += c[i].ToString(); } textBox2.Text = text; } catch (Exception ex) { MessageBox.Show(ex.Message);