如何确定某个连接所对应的文件的文件名 那是因为服务器端http://community.csdn.net/Expert/ForumList.asp?typenum=1&Roomid=5406&whichpage=2执行以后,在response的头部指定了下载文件名为ForumList.html。你用程序也是先需要得到服务器返回的信息,然后再读取分析其头部信息。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那么就是说应该使用getHeaderField方法了?不过我刚才用public String getHeaderField(int n)把所有的信息都累出来了,也没见有ForumList.html字样啊?应该用哪个Key啊?或者根本不是getHeaderField?代码如下:for (int i=0;i<10;i++) System.out.println(ucFile.getHeaderFieldKey(i)+": "+ucFile.getHeaderField(i));下面是输出:erver: Microsoft-IIS/6.0X-Powered-By: ASP.NETContent-Length: 29525Content-Type: text/htmlSet-Cookie: ASPSESSIONIDSQTBSTDB=OLFHMFHDBOKKNBJCECFILFNA; path=/Cache-control: privatenull: nullnull: null 晕!上面的输出没粘全!完整的输出是:null: HTTP/1.1 200 OKDate: Fri, 14 Oct 2005 07:11:33 GMTServer: Microsoft-IIS/6.0X-Powered-By: ASP.NETContent-Length: 29525Content-Type: text/htmlSet-Cookie: ASPSESSIONIDSQTBSTDB=FAKHMFHDPKGEIBALNHBICGFM; path=/Cache-control: privatenull: nullnull: null cxf webservice服务接口开发问题 Tomcat7.0bug处理不了啊 各位大侠,求指点啊,给点意见啦~ 关于NetworkInterface.getNetworkInterfaces()的一个问题 SSH空指针异常急救 mvc模式下的servlet是否会传值给jsp页面 hibernate 中的ava.lang.NullPointerException itext导出PDF 页码问题 ???? jboss的web-console页面,左边的菜单是用applet做的吗? jboss配置文件 请问把javabean的程序改成ejb的容易吗? 关于Struts的问题 急!!!
for (int i=0;i<10;i++)
System.out.println(ucFile.getHeaderFieldKey(i)+": "+ucFile.getHeaderField(i));
下面是输出:
erver: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 29525
Content-Type: text/html
Set-Cookie: ASPSESSIONIDSQTBSTDB=OLFHMFHDBOKKNBJCECFILFNA; path=/
Cache-control: private
null: null
null: null
完整的输出是:
null: HTTP/1.1 200 OK
Date: Fri, 14 Oct 2005 07:11:33 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-Length: 29525
Content-Type: text/html
Set-Cookie: ASPSESSIONIDSQTBSTDB=FAKHMFHDPKGEIBALNHBICGFM; path=/
Cache-control: private
null: null
null: null