Answer the question
In order to leave comments, you need to log in
An error occurs while working, where is it?
There is WCF which accepts files and saves on the server.
Client code:
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
#region Загрузка и перевод файла
FileStream fs = new FileStream(@openFileDialog1.FileName, FileMode.Open);
byte[] buffer = new byte[fs.Length];
int len = (int)fs.Length;
fs.Read(buffer, 0, len);
//string st = string.Empty;
//for (int i = 0; i < buffer.Length; i++)
//{
// st += buffer[i].ToString() + ", ";
//}
//textBox1.Text = st;
//byte[] buffer = { 37, 80, 68, 70, 45, 49, 46, 52, 10, 37, 226, 227, 207, 211, 10, 49, 32, 48, 32, 111, 98, 106, 10, 60, 60, 10, 47, 84, 121 };
fs.Close();
#endregion
client.Load("Тест", 15, "Тестовый_файл.rtf", 60, buffer); //Обращаемся к WCF
}
byte[] buffer = { 37, 80, 68, 70, 45, 49, 46, 52, 10, 37, 226, 227, 207, 211, 10, 49, 32, 48, 32, 111, 98, 106, 10, 60, 60, 10, 47, 84, 121 };
Answer the question
In order to leave comments, you need to log in
Reading a file takes time, s += is not optimal, takes time, check this time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question