long DownFileSize;
FtpWebRequest MyRequestDown = (FtpWebRequest)WebRequest.Create("ftp://...");
MyRequestDown.Credentials = new NetworkCredential(user, pass);
MyRequestDown.Method = WebRequestMethods.Ftp.GetFileSize;
FtpWebResponse SerFileSize = (FtpWebResponse)MyRequestDown.GetResponse();
DownFileSize = SerFileSize.ContentLength;
.
.
.
FileInfo FileSize = new FileInfo(Application.StartupPath ...);
this.ProgressBar.Value = Convert.ToInt32(Math.Round(FileSize.Length/DownFileSize))*100;
报编译错误:错误 1 在以下方法或属性之间的调用不明确:“System.Math.Round(double)”和“System.Math.Round(decimal)”
怎么办?
FtpWebRequest MyRequestDown = (FtpWebRequest)WebRequest.Create("ftp://...");
MyRequestDown.Credentials = new NetworkCredential(user, pass);
MyRequestDown.Method = WebRequestMethods.Ftp.GetFileSize;
FtpWebResponse SerFileSize = (FtpWebResponse)MyRequestDown.GetResponse();
DownFileSize = SerFileSize.ContentLength;
.
.
.
FileInfo FileSize = new FileInfo(Application.StartupPath ...);
this.ProgressBar.Value = Convert.ToInt32(Math.Round(FileSize.Length/DownFileSize))*100;
报编译错误:错误 1 在以下方法或属性之间的调用不明确:“System.Math.Round(double)”和“System.Math.Round(decimal)”
怎么办?
解决方案 »
- WMI获取远程服务器CPU,内存使用率问题
- 前台如何调用后台的方法.
- DataGridViewCheckBoxColumn 如何变成 DataGridViewImageColumn
- 散散分哈!关注一下!!
- 求助信号显示
- 怎么用代码实现全码数字转成半码字符
- 关于datagridview中的数据保存与读取,急用!!谢谢各位大虾先!!!
- 发送邮件的问题
- 怎么用C#写重新启动本地连接的代码?
- 关于OleDbConnection的GetOleDbSchemaTable( )方法的用法问题.
- 如何控制DropDownList可見項個數?
- “命名空间“System”中不存在类型或命名空间名称“Windows”(是缺少程序集引用吗?)”怎么解决呀?
Convert.ToInt32(Math.Round((double)(FileSize.Length/DownFileSize) * 100));
Convert.ToInt32(Math.Round((decimal)(FileSize.Length/DownFileSize) * 100));
明白了么?Math.Round()括号中不能直接放long类型。
long型的问题