this.btnDownload.Enabled = false;
this.Cursor = Cursors.WaitCursor;
if (this.dataGridView1.SelectedRows.Count == 0)
{
this.Cursor = Cursors.Default;
this.btnDownload.Enabled = true;
MessageBox.Show("未选节目");
return;
}
if(!System.IO.Directory.Exists(this.txDonwloadPath.Text))
{
this.Cursor = Cursors.Default;
this.btnDownload.Enabled = true;
MessageBox.Show("本地路径不存在");
return;
}
foreach (DataGridViewRow dgvr in this.dataGridView1.SelectedRows)
{
try
{
string fileOpenResult = this.querryObj.audioStreamCreate(this.tMaterial.Rows[dgvr.Index][3].ToString());//调用远程对象打开远程文件
if (fileOpenResult == "ok")
{
this.fileReceive(dgvr.Index);
querryObj.audioStreamClose();
this.saveFs.Close();
}
else
{
MessageBox.Show("未能打开远程文件:" + fileOpenResult);
}
}
catch (System.Runtime.Remoting.RemotingException ex)
{
MessageBox.Show("打开远程文件失败:" + ex.Message);
}
}
|