Hi Guys
I am trying to send a text file to a modem using c sharp.
In the modem manual it specifies: use Send Text file with ASCII Setup: Send line ends with line feeds and Append line feeds to incoming line ends in HyperTerminal Properties enabled.
How do you think these properties affect the text file to be sent??
Here is my code I am using to send the text file.
port.StopBits = StopBits.One;
port.Parity = Parity.None;
port.Encoding = System.Text.Encoding.GetEncoding(1252);
port.DtrEnable=true;
port.RtsEnable = true;
port.Handshake = Handshake.RequestToSend;
StreamReader readtext = new StreamReader("filename.txt");
string contents = readtext.ReadToEnd();
readtext.Close();
readtext.Dispose();
byte[] WriteBuffer=new byte[contents.Length];
ASCIIEncoding enc = new System.Text.ASCIIEncoding();
WriteBuffer = enc.GetBytes(contents);
port.Write(WriteBuffer, 0,contents.Length );