你是想在指定目录找到*.pdf吗?可以做一个函数专门用来查找 string pt=Server.MapPath(SearchPath); foreach(string s in Directory.GetFiles(pt)) { ss=s.Substring(s.LastIndexOf("\\")+1);//获得了文件名,你想怎么操作就怎么操作了,例如可以判断ss里有没有"*.pdf"有的话就把它放到数组里 }
用webservice是个好方法!关注!
webservice没有用过,谁能给个简单例子吗
建立 一个 ASP.NET Web 服务,例如叫 FileService, using System; using System.Web.Services;
public class Service1: WebService { 。 [ WebMethod(EnableSession=false)] public string GetTime() { return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } 。 }然后在另一个工程里,添加 Web 引用: http://localhost/FileService/Service1.asmx 引入后,就可以像使用本地方法一样使用 GetTime() 返回 2005-01-18 14:16:00
string pt=Server.MapPath(SearchPath);
foreach(string s in Directory.GetFiles(pt))
{
ss=s.Substring(s.LastIndexOf("\\")+1);//获得了文件名,你想怎么操作就怎么操作了,例如可以判断ss里有没有"*.pdf"有的话就把它放到数组里
}
using System.Web.Services;
public class Service1: WebService
{
。
[ WebMethod(EnableSession=false)]
public string GetTime()
{
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
。
}然后在另一个工程里,添加 Web 引用: http://localhost/FileService/Service1.asmx
引入后,就可以像使用本地方法一样使用 GetTime() 返回 2005-01-18 14:16:00
不好意思,刚才老大说了webservice不能用>_<
现在做了一个网络驱动器映射,到执行时报用户不存在或密码不正确……
请问在哪里设用户密码……
----------------------------------------------------------------------
就是不让用……,郁闷
需求设计时没说明文件不在同一个服务器……,现在急着要改……
<identity impersonate="true" userName="administrator" password="xxx" ></identity>