Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void OpenStandardStreamOut(string stringData)
- {
- // We need to send the 4 bytes of length information
- int DataLength = stringData.Length;
- // Set the encoding
- Console.OutputEncoding = new UTF8Encoding();
- Console.InputEncoding = new UTF8Encoding();
- Console.Title = "FirePrint Console";
- Stream stdout = Console.OpenStandardOutput();
- stdout.WriteByte((byte)((DataLength >> 0) & 0xFF));
- stdout.WriteByte((byte)((DataLength >> 8) & 0xFF));
- stdout.WriteByte((byte)((DataLength >> 16) & 0xFF));
- stdout.WriteByte((byte)((DataLength >> 24) & 0xFF));
- using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\Utilisateur\Desktop\native-messaging\app\debug.txt", true, Encoding.UTF8))
- {
- file.WriteLine(Console.OutputEncoding);
- file.WriteLine(stringData);
- }
- // Available total length : 4,294,967,295 ( FF FF FF FF )
- Console.Write(stringData);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement