dataSet = SqlHelper.ExecuteDataset(SqlHelper.connStr, CommandType.StoredProcedure, procName, new SqlParameter(fieldFileName, fileName)); table = dataSet.Tables[0]; string path = @"C:\Users\Administrator\Desktop\" + fileName; foreach (DataRow row in table.Rows) { using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write)) { byte[] fileByte = (byte[])row[fieldFile]; int arraySize = fileByte.Length; fs.Write(fileByte, 0, arraySize); } Process.Start(path); }
以上我的代码,只能实现打开,并复制到桌面