private void sendFile(IWebSocketConnection webSocket, string filename) { if (!File.Exists(filename)) { Log(webSocket, filename + " not exists"); return; } List <string> param = new List <string>(); param.Add(Path.GetFileName(filename)); param.Add(RSA_Unit.Base64EncodeBytes(rsa.Encode(File.ReadAllBytes(filename)))); param.Add(HashTool.SHA256File(new FileStream(filename, FileMode.Open))); Operation op = new Operation() { op = "send_file", param = param }; Log(string.Format("{0} {1}", param[0], param[2])); send(webSocket, JsonConvert.SerializeObject(op)); }