易截截图软件、单文件、免安装、纯绿色、仅160KB

socket, nio socket,及xml传递object 方法

1:如何通过socket代理来访问服务端:
String proxyHost = 
"192.168.204.212"
;   

String proxyPort = 
"1080"
;   

  

//通知Java要通过代理进行连接。
正在装载数据……
  

System.getProperties().put(
"socksProxySet"
,
"true"
);   

//指定代理所在的机器
  

System.getProperties().put(
"socksProxyHost"
,proxyHost);   

//指定代理监听的端口。
  

System.getProperties().put(
"socksProxyPort"
,proxyPort);    

  

String host = 
"134.01.69.80"
;   

int
 port = 
12086
;   

System.out.println(
"connetioning:"
 + host + 
":"
 + port);   

server = 
new
 Socket(host, port);  

二:老socket传递Object对象:
要传递的对象:
public
 
class
 Employee 
implements
 Serializable {    

  

       
private
 
int
 employeeNumber;    

       
private
 String employeeName;    

  

       Employee(
int
 num, String name) {    

          employeeNumber = num;    

          employeeName= name;    

       }    

  

        
public
 
int
 getEmployeeNumber() {    

      


相关文档:

dom4j用XPath解析xml 遇到的问题

使用dom4j解析XML时,要快速获取某个节点的数据,使用XPath是个不错的方法,dom4j的快速手册里也建议使用这种方式,标题都写的这么阔气:Powerful Navigation with XPath,呵呵。
方法是使用Document的selectNodes(String XPath)方法,代码写法:
List l = doc.selectNodes("//COLS/COL1");
执行时却抛出以下异常:
Exc ......

xml解析

xml
<mime>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009101410241364.txt</text>
</content>
<content>
<type>text/plain</type>
<big>357</big>
<text>D:\\cybercourttext2009 ......

xml选取单个节点内容解决办法

XPath 语法
2007-06-05 17:24
XPath 语法
作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 浏览:674 :: ::
XPath Nodes(节点) XPath Axes
XPath uses path expressions to select nodes or node-sets in an XML document. The node is selected by following a path or steps.
XPath 通过路径表达式从XM ......

.net中,读取XML在页面显示,布局用Repeater控件

 public static IList<News> GetAllNews()
        {
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load("你读取的地址:例如 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号