Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# User Account Question HELP! Pin
N a v a n e e t h14-May-09 17:12
N a v a n e e t h14-May-09 17:12 
GeneralRe: C# User Account Question HELP! Pin
Serpendiem14-May-09 17:18
Serpendiem14-May-09 17:18 
GeneralRe: C# User Account Question HELP! Pin
N a v a n e e t h14-May-09 17:21
N a v a n e e t h14-May-09 17:21 
GeneralRe: C# User Account Question HELP! Pin
Serpendiem14-May-09 17:32
Serpendiem14-May-09 17:32 
GeneralRe: C# User Account Question HELP! Pin
OriginalGriff14-May-09 22:41
mveOriginalGriff14-May-09 22:41 
QuestionRemoting Permission problem AFTER signing assembly Pin
devvvy14-May-09 15:12
devvvy14-May-09 15:12 
Answer... after digging around a bit Pin
devvvy14-May-09 17:29
devvvy14-May-09 17:29 
Questiona problem about timer and serialport in VC# [modified] Pin
zh.again14-May-09 15:11
zh.again14-May-09 15:11 
How can i use timer control and serialport control to dynamic refresh my number of 3 different show control......

i want to get the data form serialport....

namespace ShowNumber
{
public partial class Form1 : Form
{
//public int num = 0;
private bool serialflag = false;
public Form1()
{
InitializeComponent();
//this.label1.Text = num.ToString();
//serialPort1.Open();
}

private void timer1_Tick(object sender, EventArgs e)
{
if (!serialflag)
{
serialflag = true;
serialPort1.ReceivedBytesThreshold = 1;
try
{
this.serialPort1.Open();/// always error here
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}

}



}

private void Form1_Load(object sender, EventArgs e)
{

}


private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
byte []bt = new byte[1];

serialPort1.Read(bt,0,bt.Length);
string str = bt.ToString();
switch (str)
{
case "0":
{
MessageBox.Show("bt == 0");
label1.Text += str;
}
break;
case "1":
{
MessageBox.Show("bt == 1");
label2.Text += str;
}
break;
case "2":
{
MessageBox.Show("bt == 2");
label3.Text += str;
}
break;
case "3":
{
MessageBox.Show("bt == 3");
label4.Text += str;
}
break;
case "4":
{
MessageBox.Show("bt == 4");
label5.Text += str;
}
break;
default:
break;


}


serialPort1.Close();
serialflag = false;
}

modified on Thursday, May 14, 2009 9:48 PM

AnswerRe: a problem about timer and serialport in VC# Pin
Luc Pattyn14-May-09 15:24
sitebuilderLuc Pattyn14-May-09 15:24 
GeneralRe: a problem about timer and serialport in VC# Pin
zh.again14-May-09 15:53
zh.again14-May-09 15:53 
QuestionBBS Door Library in C# Pin
bigjoe11a14-May-09 13:29
bigjoe11a14-May-09 13:29 
AnswerRe: BBS Door Library in C# Pin
James Plotts5-Jul-14 6:59
James Plotts5-Jul-14 6:59 
AnswerRe: BBS Door Library in C# Pin
James Plotts5-Jul-14 7:00
James Plotts5-Jul-14 7:00 
QuestionConfigurationException and ConfigurationErrorException Pin
Dan Neely14-May-09 10:18
Dan Neely14-May-09 10:18 
AnswerRe: ConfigurationException and ConfigurationErrorException Pin
Dan Neely14-May-09 14:10
Dan Neely14-May-09 14:10 
QuestionHow to add Admin creds to my program ? Pin
partialdata14-May-09 10:14
partialdata14-May-09 10:14 
QuestionClick Once & Application Cache Pin
BlitzPackage14-May-09 9:46
BlitzPackage14-May-09 9:46 
AnswerRe: Click Once & Application Cache Pin
Graeme Bosworth26-Apr-10 20:35
Graeme Bosworth26-Apr-10 20:35 
Questionhelp Pin
Alex_xso14-May-09 9:23
Alex_xso14-May-09 9:23 
AnswerRe: help Pin
Anthony Mushrow14-May-09 9:32
professionalAnthony Mushrow14-May-09 9:32 
QuestionError 170:In correct Syntax- SQL Server and C# Pin
SilimSayo14-May-09 8:22
SilimSayo14-May-09 8:22 
AnswerRe: Error 170:In correct Syntax- SQL Server and C# Pin
Ian McCaul14-May-09 8:28
Ian McCaul14-May-09 8:28 
GeneralRe: Error 170:In correct Syntax- SQL Server and C# Pin
SilimSayo14-May-09 8:47
SilimSayo14-May-09 8:47 
QuestionMonitor a text file to see when it opens or closes... Pin
Engineer Joe14-May-09 7:48
Engineer Joe14-May-09 7:48 
AnswerRe: Monitor a text file to see when it opens or closes... Pin
DaveyM6914-May-09 7:59
professionalDaveyM6914-May-09 7:59 

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.