简体   繁体   English

在Silverlight .NET中要上传(附加)的文件的大小

[英]Size of the file to be uploaded (attached) in silverlight .NET

I am making an attachment component in Silverlight and was wondering if they do have an api in Silverlight .NET or a way to know the size of the file before I start uploading it. 我在Silverlight中制作一个附件组件,想知道他们在Silverlight .NET中是否有一个api或在开始上传之前知道文件大小的方法。 Something like Gmail... 像Gmail这样的东西...

Thanks 谢谢

OpenFileDialog ofd = new OpenFileDialog();
const int megaSize = 1024000;
            if (ofd.File.Length > megaSize)
                ShowError("Can not upload images with this size.");

Hope it helps 希望能帮助到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM