网友,你是Applet还是Application。怎么还有java -Dhttp.proxyHost=proxyHost?
解决方案 »
- Java 怎样在文件中从文件头处查找指定字符串?并显示print出来
- JFrame与Frame的区别引起的问题
- java Swing 面板间的切换问题..
- 求助(连接数据库)为什么会报错?
- 怎样在java中随机生成日期,日期的格式最好是yyyy-mm-dd
- JAVA群交流
- swing怎么得到当前活动的mdi子窗口
- java中的double类型只能表示如1234567.12形式的数值,整数部分超过七位就变成了科学计数法,请各大侠指点,如何突破七位限制
- 多个JList判断的问题
- 请问哪本讲jndi编程的书好(急,在线等)
- 如何对菜单项创快捷键 F5?????????????????????????????????
- 请问:java2D,java3D图形设计方面的资料(web site or books)
才能运行。
你是想在applet里用别的服务器的数据啊。如果是的话。你要求不可能实现。因为applet只能与来源服务器通信。你能说的更清楚点吗?
Or in your source : import java.util.Properties;
...Properties systemSettings = System.getProperties();
systemSettings.put("proxySet", "true");
systemSettings.put("proxyHost", "myProxyServer.com");
systemSettings.put("proxyPort", "80");
System.setProperties(systemSettings); --------------------------------------------------------------------------------
NOTE:
You might need to identify yourself to the proxy server. Use the HTTP property "Proxy-Authorization" with a username:password base64 encoded. Properties systemSettings = System.getProperties();
...
System.setProperties(systemSettings);URL url=new URL("http://someserver/somepage");
URLConnection uc = url.openConnection ();
String encoded = new String(Base64.base64Encode(new String("username:password").getBytes()));
uc.setRequestProperty("Proxy-Authorization", "Basic " + encoded);
uc.connect();
这样做是想干什么呢,难道有什么用吗?
先多谢各位大侠的热心帮助!!请问为什么要加如下语句:String encoded = new String(Base64.base64Encode(new String("username:password").getBytes()));
uc.setRequestProperty("Proxy-Authorization", "Basic " + encoded);先谢了!!!
先多谢各位大侠的热心帮助!!请问为什么要加如下语句:String encoded = new String(Base64.base64Encode(new String("username:password").getBytes()));
uc.setRequestProperty("Proxy-Authorization", "Basic " + encoded);先谢了!!!
yangzi(笨笨)
skyyoung(路人甲)
lmy2000(pluto)