Click here to Skip to main content
15,891,905 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: DSL internet - 2 pc's - one ethernet port router Pin
Dave Kreskowiak16-Jul-07 17:00
mveDave Kreskowiak16-Jul-07 17:00 
GeneralRe: DSL internet - 2 pc's - one ethernet port router [modified] Pin
Thisita17-Jul-07 6:04
Thisita17-Jul-07 6:04 
GeneralRe: DSL internet - 2 pc's - one ethernet port router Pin
Dave Kreskowiak17-Jul-07 6:26
mveDave Kreskowiak17-Jul-07 6:26 
GeneralRe: DSL internet - 2 pc's - one ethernet port router Pin
Thisita17-Jul-07 7:07
Thisita17-Jul-07 7:07 
QuestionCP and servers Pin
Rohde11-Jul-07 0:31
Rohde11-Jul-07 0:31 
AnswerRe: CP and servers Pin
Sebastian Schneider11-Jul-07 1:14
Sebastian Schneider11-Jul-07 1:14 
AnswerRe: CP and servers Pin
#realJSOP12-Jul-07 1:37
mve#realJSOP12-Jul-07 1:37 
Questionproblem of reading from serial port Pin
supercsharp110-Jul-07 22:06
supercsharp110-Jul-07 22:06 
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);
}
}
}
AnswerRe: problem of reading from serial port Pin
Steve S11-Jul-07 3:06
Steve S11-Jul-07 3:06 
GeneralRe: problem of reading from serial port Pin
supercsharp111-Jul-07 16:21
supercsharp111-Jul-07 16:21 
GeneralRe: problem of reading from serial port Pin
Steve S12-Jul-07 6:57
Steve S12-Jul-07 6:57 
AnswerRe: problem of reading from serial port Pin
Luc Pattyn12-Jul-07 7:21
sitebuilderLuc Pattyn12-Jul-07 7:21 
QuestionFile manager for USB device Pin
Tamal Saha8-Jul-07 9:55
Tamal Saha8-Jul-07 9:55 
AnswerRe: File manager for USB device Pin
#realJSOP9-Jul-07 2:10
mve#realJSOP9-Jul-07 2:10 
QuestionPC not working Pin
Hiteshforu20076-Jul-07 23:49
Hiteshforu20076-Jul-07 23:49 
AnswerRe: PC not working Pin
Dave Kreskowiak7-Jul-07 7:28
mveDave Kreskowiak7-Jul-07 7:28 
AnswerRe: PC not working Pin
#realJSOP9-Jul-07 2:13
mve#realJSOP9-Jul-07 2:13 
Questionneed code to find serial number of hardware Pin
omidreza8126-Jul-07 20:36
omidreza8126-Jul-07 20:36 
AnswerRe: need code to find serial number of hardware Pin
#realJSOP9-Jul-07 2:15
mve#realJSOP9-Jul-07 2:15 
QuestionParallel Port Help Pin
meki_21184-Jul-07 4:18
meki_21184-Jul-07 4:18 
AnswerRe: Parallel Port Help Pin
CPallini4-Jul-07 4:26
mveCPallini4-Jul-07 4:26 
QuestionPentium 5 Pin
Aman.Jen3-Jul-07 23:06
Aman.Jen3-Jul-07 23:06 
AnswerRe: Pentium 5 [modified] Pin
Jimmanuel5-Jul-07 2:21
Jimmanuel5-Jul-07 2:21 
GeneralRe: Pentium 5 Pin
Dan Neely5-Jul-07 2:25
Dan Neely5-Jul-07 2:25 
QuestionGeneric USB access Pin
legit3-Jul-07 4:32
legit3-Jul-07 4:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.