ASP [WebMethod] 方法里面用 "~\UploadFile\“怎么获取的不是当前项目下的路劲 asp发布 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把路径配置到web.config里读写文件前,先从web.config里读出配置的路径... ~\UploadFile\ 变成物理路径,需要使用Server.MapPath详见:http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath(v=vs.110).aspx 我这样用 srcFileName = HttpContext.Current.Server.MapPath("~/UploadFile/“+xxx.doc);在本机上是可以用,但发布后,其他机子上却访问不到,其他机子上传文件到服务器,也上传不上去,本机上测试都没问题,不知道怎么回事啊? 找到问题出错地方了, object Nothing = System.Reflection.Missing.Value; object format = Word2.WdSaveFormat.wdFormatDocument; Word2.Application wordApp = new Word2.Application(); //这句话就出问题了,应该是其他电脑没有访问服务器的Word的权限,其他电脑输出出错信息如下图: srcFileName = HttpContext.Current.Server.MapPath("~/UploadFile/han.dotx"); //[路径需要按实际情况修改] Word2.Document wordDoc2 = wordApp.Documents.Open(ref srcFileName, ref format, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing); 目前检测到这句出错,还不晓得路劲那里到底对不对。怎么设置Word,让其他电脑可以访问? outlook或QQ邮箱的收件人 调用webservice的报错 视频控件的求助。。 asp.net 数据无法导出??? 请教大家一个问题,关于asp.net mvc 路由中正则的问题[急] TreeView的结点收回与展开? windows2003支持asp.net的站点这样设置权限才安全? Excel导入数据库中得一些问题,新人求教! ASP.net中 如何用 C# 调用含有参数的Javascript函数 求助高手,asp.net的webform中,如果控制page对象的生成? ASP.NET中的js日历控件不能正常显示 "未将对象引用设置到对象的实例。"求个大神帮忙解决一下
读写文件前,先从web.config里读出配置的路径...
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath(v=vs.110).aspx
我这样用 srcFileName = HttpContext.Current.Server.MapPath("~/UploadFile/“+xxx.doc);
在本机上是可以用,但发布后,其他机子上却访问不到,其他机子上传文件到服务器,也上传不上去,本机上测试都没问题,不知道怎么回事啊?
object Nothing = System.Reflection.Missing.Value;
object format = Word2.WdSaveFormat.wdFormatDocument;
Word2.Application wordApp = new Word2.Application(); //这句话就出问题了,应该是其他电脑没有访问服务器的Word的权限,
其他电脑输出出错信息如下图:
srcFileName = HttpContext.Current.Server.MapPath("~/UploadFile/han.dotx"); //[路径需要按实际情况修改]
Word2.Document wordDoc2 = wordApp.Documents.Open(ref srcFileName, ref format, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
目前检测到这句出错,还不晓得路劲那里到底对不对。怎么设置Word,让其他电脑可以访问?