POLUtils.AuxSvc.AuxSvcConnection.Read C# (CSharp) Méthode

Read() public méthode

Returns the current contents of the AuxStream in string format.
public Read ( ) : string
Résultat string
        public string Read()
        {
            try
            {
                if (AuxSocket.Connected)
                    return AuxReader.ReadLine();
                else
                    throw new IOException("Aux Svc Connection Is Not Active For Read!");
            }
            catch (System.OutOfMemoryException ex)
            {
                // FIXME:  We need to make an exception build here for checking in the 
                // end-user's code. 
                return ("System.OutOfMemoryException: " + ex);
            }
            catch (System.IO.IOException ex)
            {
                // FIXME:  We need to make an exception build here for checking in the 
                // end-user's code. 
                return ("System.IO.IOException: " + ex);
            }
        }

Usage Example

Exemple #1
0
 private void testAuxButton_Click(object sender, EventArgs e)
 {
     // Create the AuxSvc Object for your program. This will automatically
     // try to connect to your host/port and prepare you to be able to 
     // send your information to POL.
     AuxSvcConnection TestAuxSvc = new AuxSvcConnection(serverHost.Text.ToString(), Convert.ToInt32(serverPort.Text));
     if (!TestAuxSvc.Active)
     {
         MessageBox.Show("Server appears to be offline. Make sure host and port are correct.");
         return;
     }
     TestAuxSvc.Write(PackUnpack.Pack(auxSendText.Text.ToString()));
     string ReadString = TestAuxSvc.Read();
     object ReadObject = PackUnpack.Unpack(ReadString.ToString());
     ArrayList ReadArray = (ArrayList)ReadObject;
     auxRecvText.Text = ReadArray[0] + " " + ReadArray[1] + " " + ReadArray[2];
     TestAuxSvc.Close();
 }
All Usage Examples Of POLUtils.AuxSvc.AuxSvcConnection::Read