[英]How to open files using theirs default application in SilverLight Webapplication?
任何人都可以建议一种在Silverlight应用程序中使用其默认应用程序打开文件的方法。 我能够获取我选择的文件的完整路径。
那是为了在上传之前验证文件。 使用此方法时:
AutomationFactory.CreateObject("WScript.Shell").Run(FileList[_index].filepath);
我懂了
System.IO.FileNotFoundException
如果文件名中包含空格 ,则无法使用。
如果要使用空格打开文件路径,则需要在路径周围添加引号。 尝试使用:
"\\"" + FILE_PATH + "\\""
在您的代码中:
AutomationFactory.CreateObject("WScript.Shell").Run("\"" + FileList[_index].filepath + "\"");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.