Tag: httpwebrequest

从url下载.xls文件

我试图从url下载一个xls文件: http : //www.site.com/ff/excel/file.aspx? deven =0 我正在使用此代码,但下载完成后,文件没有正确下载。 我怎样才能正确地下载这个文件? string remoteFilename="http://www.site.com/ff/excel/file.aspx?deven=0"; string localFilename = "D:\\1\\1.xls"; Stream remoteStream = null; Stream localStream = null; WebResponse response = null; try { // Create a request for the specified remote file name WebRequest request = WebRequest.Create(remoteFilename); if (request != null) { // Send the request to the server and […]