Click here to Skip to main content
15,885,870 members
Home / Discussions / C#
   

C#

 
GeneralRe: Run application until Tasks are finished? Pin
Dralken31-Aug-13 1:26
Dralken31-Aug-13 1:26 
GeneralRe: Run application until Tasks are finished? Pin
BillWoodruff1-Sep-13 19:51
professionalBillWoodruff1-Sep-13 19:51 
GeneralRe: Run application until Tasks are finished? Pin
Dralken1-Sep-13 20:40
Dralken1-Sep-13 20:40 
SuggestionRe: Run application until Tasks are finished? Pin
Keith L Robertson3-Sep-13 5:27
Keith L Robertson3-Sep-13 5:27 
QuestionHow to solve this error "safe handle has been closed"? Pin
vikash kumar NIIT29-Aug-13 23:16
vikash kumar NIIT29-Aug-13 23:16 
SuggestionRe: How to solve this error "safe handle has been closed"? Pin
Richard Deeming30-Aug-13 1:38
mveRichard Deeming30-Aug-13 1:38 
GeneralRe: How to solve this error "safe handle has been closed"? Pin
vikash kumar NIIT30-Aug-13 1:50
vikash kumar NIIT30-Aug-13 1:50 
GeneralRe: How to solve this error "safe handle has been closed"? Pin
davidstein30-Aug-13 3:06
davidstein30-Aug-13 3:06 
C#
private void Form1_Load(object sender, EventArgs e)
       {
           readThread = new Thread(new ThreadStart(Read));
           port = new SerialPort();

           port.BaudRate = 921600;
           port.PortName = "COM16";
           port.Parity = Parity.None;
           port.DataBits = 8;
           port.StopBits = StopBits.One;
           port.ReadTimeout = 30000;
           port.WriteTimeout = 30000;
         //  port.Handshake = Handshake.XOnXOff;
           port.DtrEnable = true;
           port.RtsEnable = true;
              port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
           port.Open();


       }

       private void buttonSend_Click(object sender, EventArgs e)
       {
           port.Write("AT+CUSD=1,\"*140*1#\",15" + System.Environment.NewLine);

       }


       private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
       {


               SerialPort spL = (SerialPort)sender;
               byte[] buf = new byte[spL.BytesToRead];
               spL.Read(buf, 0, buf.Length);
               foreach (Byte b in buf)
               {
                   message += b.ToString();
               }
               textBoxSMS.BeginInvoke((MethodInvoker)delegate()
               {
                   textBoxSMS.Text += Encoding.ASCII.GetString(buf);
               });

       }

GeneralRe: How to solve this error "safe handle has been closed"? Pin
Richard Deeming30-Aug-13 3:21
mveRichard Deeming30-Aug-13 3:21 
Questionhow to get balance by USSD commands? Pin
davidstein29-Aug-13 22:58
davidstein29-Aug-13 22:58 
SuggestionRe: how to get balance by USSD commands? Pin
Richard MacCutchan30-Aug-13 0:03
mveRichard MacCutchan30-Aug-13 0:03 
GeneralRe: how to get balance by USSD commands? Pin
davidstein30-Aug-13 1:04
davidstein30-Aug-13 1:04 
GeneralRe: how to get balance by USSD commands? PinPopular
Dave Kreskowiak30-Aug-13 2:42
mveDave Kreskowiak30-Aug-13 2:42 
GeneralRe: how to get balance by USSD commands? Pin
davidstein30-Aug-13 3:05
davidstein30-Aug-13 3:05 
GeneralRe: how to get balance by USSD commands? Pin
Richard MacCutchan30-Aug-13 3:27
mveRichard MacCutchan30-Aug-13 3:27 
GeneralRe: how to get balance by USSD commands? Pin
Dave Kreskowiak30-Aug-13 3:59
mveDave Kreskowiak30-Aug-13 3:59 
GeneralRe: how to get balance by USSD commands? Pin
davidstein30-Aug-13 8:27
davidstein30-Aug-13 8:27 
GeneralRe: how to get balance by USSD commands? Pin
Dave Kreskowiak30-Aug-13 12:45
mveDave Kreskowiak30-Aug-13 12:45 
Questionhow to writ code for percentage in windows application form Pin
ashwini dharamsale29-Aug-13 22:31
ashwini dharamsale29-Aug-13 22:31 
AnswerRe: how to writ code for percentage in windows application form Pin
Simon_Whale29-Aug-13 23:05
Simon_Whale29-Aug-13 23:05 
GeneralRe: how to writ code for percentage in windows application form Pin
ashwini dharamsale29-Aug-13 23:09
ashwini dharamsale29-Aug-13 23:09 
GeneralRe: how to writ code for percentage in windows application form Pin
Simon_Whale29-Aug-13 23:17
Simon_Whale29-Aug-13 23:17 
GeneralRe: how to writ code for percentage in windows application form Pin
ashwini dharamsale29-Aug-13 23:20
ashwini dharamsale29-Aug-13 23:20 
GeneralRe: how to writ code for percentage in windows application form Pin
NotPolitcallyCorrect30-Aug-13 1:32
NotPolitcallyCorrect30-Aug-13 1:32 
GeneralRe: how to writ code for percentage in windows application form Pin
Forbiddenx30-Aug-13 2:57
Forbiddenx30-Aug-13 2:57 

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.