arjunwalmiki's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
12 (0.02 per day)
Joined:
19-November 12
Profile Views:
1,139
Last Active:
User is offline Mar 20 2013 04:39 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   arjunwalmiki has not set their status

Posts I've Made

  1. In Topic: Serial Port Communication in C#

    Posted 27 Nov 2012

    View PostFred_Lee, on 11 September 2012 - 02:23 PM, said:

    Great Tutorial.
    I found I was unable to close the port, so tried the code below:

    in frmMain.cs
            private void cmdClose_Click(object sender, EventArgs e)
            {
                comm.PortName = cboPort.Text;
                comm.ClosePort();
              
    
                cmdOpen.Enabled = true;
                cmdClose.Enabled = false;
                cmdSend.Enabled = true;
            }
            
    



    also in CommunicationManager.cs

            #region ClosePort
            public bool ClosePort()
            {
                try
                {
                    //first check if the port is already open
                    //if its open then close it
                    if ((comPort.IsOpen == true) && (comPort.BytesToRead == 0)) comPort.Close();
    
                    //display message
                    DisplayData(MessageType.Normal, "Port closed at " + DateTime.Now + "\n");
                    //return false
                    return false;
                }
                catch (Exception ex)
                {
                    DisplayData(MessageType.Error, ex.Message);
                    return true;
                }
            } 
            #endregion
            
    


    it seems to work OK.

    I am puzzled by the code below:

    in frmMain.cs
            private void rtbDisplay_TextChanged(object sender, EventArgs e)
            {
    
            }
            
    

    It does'nt seem to be referenced anywhere. What does it do?
    Any ideas would be appreciated.




    pLS Check all code when we click on closed button so no need of
    //display message
    DisplayData(MessageType.Normal, "Port closed at " + DateTime.Now + "\n");

    code it is create confusion
  2. In Topic: Serial Port Communication in C#

    Posted 27 Nov 2012

    View PostTenRC, on 14 January 2009 - 01:34 PM, said:

    The downloaded file is corrupt or incomplete. Please test and verify. I have uploaded what I received.

    sir it is very nice tutorial.

    know i have done little change in that program
    1)I was all data those are display rtbDisplay (RichTextBox) it will save at my desktop in txt file the code are as below:-

    private void cmdOpen_Click(object sender, EventArgs e)
    {
    comm.PortName = cboPort.Text;
    comm.Parity = cboParity.Text;
    comm.StopBits = cboStop.Text;
    comm.DataBits = cboData.Text;
    comm.BaudRate = cboBaud.Text;
    if (rtbDisplay != null)
    {
    comm.DisplayWindow = rtbDisplay;
    // FileMode.Append
    StreamWriter sw = new StreamWriter("C:\\Users\\Arjun\\Desktop\\test.txt");

    sw.WriteLine(rtbDisplay.Text);
    sw.Close();


    }
    Know i want to hide the rtbDisplay(Rich Text Box) and write same data in test.txt with \n .so pls help me wt i do any body pls

    But i want to display

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

arjunwalmiki hasn't added any friends yet.

Comments

arjunwalmiki has no profile comments yet. Why not say hello?