HttpWebRequest / HttpWebResponse 远程获取文件信息


HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(path+filename); //创建一个请求(获得需要的文件信息)
HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
string gorlseftDate = myRes.LastModified.ToString("yyyy-MM-dd hh:mm:ss");//获得dataServer.rar的创建时间

 myRes中还有许多相关的信息,根据自己的需要去获取吧。

原文地址:https://www.cnblogs.com/pigddyou/p/3713437.html