Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: upkey on serialport Pin
Rajesh Anuhya21-Oct-10 19:15
professionalRajesh Anuhya21-Oct-10 19:15 
Questionusing wild card characters in batch file Pin
prasadbuddhika20-Oct-10 20:23
prasadbuddhika20-Oct-10 20:23 
QuestionRe: using wild card characters in batch file Pin
Peter_in_278020-Oct-10 20:25
professionalPeter_in_278020-Oct-10 20:25 
AnswerRe: using wild card characters in batch file Pin
prasadbuddhika20-Oct-10 20:42
prasadbuddhika20-Oct-10 20:42 
AnswerRe: using wild card characters in batch file Pin
Rajesh Anuhya20-Oct-10 20:46
professionalRajesh Anuhya20-Oct-10 20:46 
Questiondesktop notification Pin
kjgiiy20-Oct-10 16:08
kjgiiy20-Oct-10 16:08 
AnswerRe: desktop notification Pin
Richard MacCutchan20-Oct-10 22:06
mveRichard MacCutchan20-Oct-10 22:06 
QuestionSerialPort Pin
Tichaona J20-Oct-10 10:56
Tichaona J20-Oct-10 10:56 
Hi - I am trying to send a simple string over an established Bluetooth connection using serial port. The probelm here is I don't know if what I am doing is correct as neither application are throwing any exceptions. Here is the code for the remote application

private void btnConnect_Click(object sender, EventArgs e)
{

try
{
SerialPort inPort = new SerialPort("COM2", 9600);

inPort.Open();

string message = "Hello";
inPort.Write(message);

inPort.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

}

On the other end I have used an event handler:


private void DataReceviedHandler(object sender, SerialDataReceivedEventArgs e)
{
try
{

SerialPort inPort = new SerialPort("COM7", 9600);
inPort.Open();

string mess = inPort.ReadLine();

MessageBox.Show("This worked...");

inPort.Close();

}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}



}

}

When I click on the button on the external application nothing happens? Any ideas????Confused | :confused:
AnswerRe: SerialPort Pin
Luc Pattyn20-Oct-10 13:06
sitebuilderLuc Pattyn20-Oct-10 13:06 
AnswerRe: SerialPort Pin
Rajesh Anuhya20-Oct-10 20:10
professionalRajesh Anuhya20-Oct-10 20:10 
GeneralRe: SerialPort Pin
Tichaona J21-Oct-10 3:41
Tichaona J21-Oct-10 3:41 
QuestionC# Generics help Pin
gi122620-Oct-10 5:47
professionalgi122620-Oct-10 5:47 
AnswerRe: C# Generics help PinPopular
harold aptroot20-Oct-10 6:06
harold aptroot20-Oct-10 6:06 
GeneralRe: C# Generics help Pin
gi122621-Oct-10 2:59
professionalgi122621-Oct-10 2:59 
QuestionVS designer (C#) Pin
kapax520-Oct-10 4:53
kapax520-Oct-10 4:53 
QuestionHow to sniff traffic of only one application Pin
rahul.kulshreshtha20-Oct-10 4:05
rahul.kulshreshtha20-Oct-10 4:05 
QuestionProblem with adding new record to the datagridview with Master/Child relationship Pin
Hardz20-Oct-10 0:47
Hardz20-Oct-10 0:47 
AnswerRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
rah_sin20-Oct-10 1:07
professionalrah_sin20-Oct-10 1:07 
GeneralRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
Hardz20-Oct-10 14:39
Hardz20-Oct-10 14:39 
GeneralRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
Hardz20-Oct-10 15:27
Hardz20-Oct-10 15:27 
AnswerRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
PIEBALDconsult20-Oct-10 3:21
mvePIEBALDconsult20-Oct-10 3:21 
GeneralRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
Hardz20-Oct-10 14:33
Hardz20-Oct-10 14:33 
GeneralRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
PIEBALDconsult21-Oct-10 3:06
mvePIEBALDconsult21-Oct-10 3:06 
AnswerRe: Problem with adding new record to the datagridview with Master/Child relationship Pin
Hardz28-Oct-10 23:56
Hardz28-Oct-10 23:56 
QuestionNeed help Pin
rksreadero19-Oct-10 16:33
rksreadero19-Oct-10 16:33 

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.