资源简介

这是一个客户端程序。启动程序,能够自动连接局域网的电脑,邀请它们参与投票。客户能够发起投票和参与投票。参与的和发起的投票都会记录在日志文件中。

资源截图

代码片段和文件信息

package jovter_Server;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;

public class JV_BroadcastVote extends Thread{

private DatagramSocket socket = null;
private InetAddress group = null;
private String str = null;

public JV_BroadcastVote(String s){
this.str = s;
}

public void run(){

try {
socket = new DatagramSocket();
} catch (SocketException e) {
e.printStackTrace();
}

byte[] buf = new byte[256];
buf = str.getBytes();

try {
group = InetAddress.getByName(“230.0.0.2“);
} catch (UnknownHostException e) {
e.printStackTrace();
}

DatagramPacket packet = new DatagramPacket(bufbuf.lengthgroup4447);

try {
socket.send(packet);
} catch (IOException e) {
e.printStackTrace();
}
socket.close();
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        232  2010-12-01 16:49  JavaVoter\.classpath

     文件        385  2010-12-01 16:49  JavaVoter\.project

     文件       1475  2010-12-05 10:19  JavaVoter\bin\jovter_Server\JV_BroadcastVote.class

     文件       1260  2010-12-05 15:13  JavaVoter\bin\jovter_Server\JV_InitiateForm$1.class

     文件       1260  2010-12-05 15:13  JavaVoter\bin\jovter_Server\JV_InitiateForm$2.class

     文件        754  2010-12-05 15:13  JavaVoter\bin\jovter_Server\JV_InitiateForm$3.class

     文件       2927  2010-12-05 15:13  JavaVoter\bin\jovter_Server\JV_InitiateForm.class

     文件       1475  2010-12-05 10:19  JavaVoter\bin\jovter_Server\JV_MulticastVote.class

     文件       3510  2010-12-05 11:03  JavaVoter\bin\jovter_Server\JV_ReceiveReply.class

     文件       1422  2010-12-05 08:42  JavaVoter\bin\jovter_Server\JV_SendHello.class

     文件        925  2010-12-05 09:08  JavaVoter\bin\jovter_Server\JV_TrayIcon$1.class

     文件        724  2010-12-05 09:08  JavaVoter\bin\jovter_Server\JV_TrayIcon$2.class

     文件        705  2010-12-05 09:08  JavaVoter\bin\jovter_Server\JV_TrayIcon$3.class

     文件       2003  2010-12-05 09:08  JavaVoter\bin\jovter_Server\JV_TrayIcon.class

     文件        933  2010-12-05 09:16  JavaVoter\bin\jvoter_Client\JV_HelloForm$1.class

     文件        740  2010-12-05 09:16  JavaVoter\bin\jvoter_Client\JV_HelloForm$2.class

     文件       4112  2010-12-05 09:16  JavaVoter\bin\jvoter_Client\JV_HelloForm.class

     文件       2056  2010-12-05 10:08  JavaVoter\bin\jvoter_Client\JV_ReceiveBroad.class

     文件       1958  2010-12-04 23:44  JavaVoter\bin\jvoter_Client\JV_ReceiveHello.class

     文件       2056  2010-12-05 10:19  JavaVoter\bin\jvoter_Client\JV_ReceiveMulti.class

     文件       1036  2010-12-05 11:09  JavaVoter\bin\jvoter_Client\JV_VoteMessage$1.class

     文件       1035  2010-12-05 11:09  JavaVoter\bin\jvoter_Client\JV_VoteMessage$2.class

     文件       1040  2010-12-05 11:09  JavaVoter\bin\jvoter_Client\JV_VoteMessage$3.class

     文件       4849  2010-12-05 11:09  JavaVoter\bin\jvoter_Client\JV_VoteMessage.class

     文件        674  2010-12-05 16:46  JavaVoter\bin\jvoter_Main\JV_Main.class

     文件        965  2010-12-05 10:11  JavaVoter\src\jovter_Server\JV_BroadcastVote.java

     文件       2783  2010-12-05 15:13  JavaVoter\src\jovter_Server\JV_InitiateForm.java

     文件        965  2010-12-05 10:12  JavaVoter\src\jovter_Server\JV_MulticastVote.java

     文件       3826  2010-12-05 11:03  JavaVoter\src\jovter_Server\JV_ReceiveReply.java

     文件        898  2010-12-05 00:24  JavaVoter\src\jovter_Server\JV_SendHello.java

............此处省略22个文件信息

评论

共有 条评论