我想讀取文件的內容使用文件對話框,然後將其保存在一個字節數組打開它傳遞到Web服務將整個文件讀入一個字節數組中的WinForms
Stream myStream;
OpenFileDialog saveFileDialog1 = new OpenFileDialog();
saveFileDialog1.Filter = "zip files (*.zip)|*.zip|All files (*.*)|*.*";
saveFileDialog1.FilterIndex = 2;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = saveFileDialog1.OpenFile()) != null)
{
NSITESERVICE.UploadSoapClient obj = new NSITESERVICE.UploadSoapClient();
byte[] filebytes = //what should i pass it over here...
obj.UploadFile("kamal", "[email protected]", filebytes);
// Code to write the stream goes here.
myStream.Close();
}
}
我不知道我在哪裏錯了
任何幫助表示讚賞。 Thnaks
我應該傳遞給byte [] filebytes。 – Moons