Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends
i don't know how to use kermit protocol.i have three txt file a,b,c and i want to write these file on linux device by using serial communication ,problem is that these file has to be written to use of kermit protocol and i don't know how to use it in my c# application
my written function is........
C#
public void Fun_SendFile(string path, string filename)
       {

C#
port.DiscardInBuffer();
            Thread.Sleep(100);
            port.DiscardOutBuffer();
            Thread.Sleep(1000);
            string removefile = "rm" + " " + filename.ToLower();
            Fun_SendCommand(removefile.Trim());
            Thread.Sleep(1000);
            Fun_SendCommand("ls".Trim());
            Thread.Sleep(100);
            StreamReader readtext = new StreamReader(path);
            contents = "echo" + " " + '*';
            contents = contents + readtext.ReadToEnd() + '*' + ">>" + " ";
            contents = contents + filename.ToLower();
            contents = contents.Replace('*', '"');//.Replace('2','"');          
            contents = contents.Replace("\r", "").Replace("\n", "");
            byte[] bt = Encoding.UTF8.GetBytes(contents);
            port.Write(bt, 0, bt.Length);         
}  
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900