91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

ANDROID 手機投票器APP,可用于班級投票。使用SOCKET通信,分服務器和客戶端兩部分程序。-Mobile voting machine ANDROID APP, can be used in class vote. Use SOCKET communications, and server and client in two parts of the program.

資源截圖

代碼片段和文件信息

package?Server;

import?java.awt.TextArea;
import?java.io.BufferedReader;
import?java.io.BufferedWriter;
import?java.io.DataInputStream;
import?java.io.DataOutputStream;
import?java.io.IOException;
import?java.io.InputStreamReader;
import?java.io.OutputStream;
import?java.io.OutputStreamWriter;
import?java.io.UnsupportedEncodingException;
import?java.net.Socket;
import?java.util.Map.Entry;
import?java.util.Set;


public?class?ServerThread?implements?Runnable{

private?Socket?s;
private?TextArea?ta;
BufferedReader?in;
BufferedWriter?out;

public?ServerThread(Socket?s?TextArea?ta)?{
//?TODO?Auto-generated?constructor?stub
this.s?=?s;
this.ta?=?ta;
}

@Override
public?void?run()?{
try?{
DataInputStream?inFromClient=new?DataInputStream(s.getInputStream());
?????String?ClientSentence?=?inFromClient.readUTF();
?ta.append(“receive:“+ClientSentence+“\t\n“);
?ClientSentence=HandleMsg(ClientSentence);
?out=new?BufferedWriter(new?OutputStreamWriter(s.getOutputStream()“UTF-8“));
?out.write(ClientSentence);
?out.flush();
?ta.append(“send:“+ClientSentence+“\t\n“);
?s.close();
}?catch?(IOException?e)?{
e.printStackTrace();
}
}

//處理發來的信息
private?String?HandleMsg(String?str)?{
String?result=“-1“;
String[]?strs=str.split(“_“);ta.append(“strs[0]:“?+?strs[0]?+?“\t\n“);
if(strs[0].equals(“Teacher“)){ ta.append(“enter?tescher\t\n“);
result=?HandleTeacherMsg(strs);
}
else?if(strs[0].equals(“Student“)){
ta.append(“enter?student\t\n“);
result=?HandlerStrudentMsg(strs);
}
return?result;

}

//處理學生發來的信息
private?String?HandlerStrudentMsg(String[]?strs)?{
//判斷可投票
if(!ServerUI.isStartVote)
return?“-1“;
//記錄
if(ServerUI.hashMap.containsKey(strs[1])){
Integer?i=ServerUI.hashMap.get(strs[1]);
i++;
ServerUI.hashMap.remove(strs[1]);
ServerUI.hashMap.put(strs[1]?i);
ta.append(“名稱:“?+?strs[1]?+?“數目+1,為“+i+“\t\n“);
}
else{
ServerUI.hashMap.put(strs[1]?1);
ta.append(“新增名稱:“?+?strs[1]?+?“\t\n“);
}
return?“1“;
}

//處理教師發來的信息
private?String?HandleTeacherMsg(String[]?strs)?{
String?result=“-1“;
if(strs[1].equals(“StartVote“)){
ServerUI.isStartVote=true;
ta.append(“可以投票了\t\n“);
result=“1“;
}
else?if(strs[1].equals(“EndVote“)){
ServerUI.isStartVote=false;
ta.append(“結束投票\t\n“);
result=“1“;
}
else?if(strs[1].equals(“Visit“)){
StringBuilder?stringBuilder=new?StringBuilder();
Set>?data=?ServerUI.hashMap.entrySet();
for(Entry?entry:data){
stringBuilder.append(entry.getKey()+“_“+entry.getValue()+“__“);
}
stringBuilder.delete(stringBuilder.length()-2?stringBuilder.length());
ta.append(“發送:“?+?stringBuilder.toString()?+?“\t\n“);
result=stringBuilder.toString()?;
}
else?if(strs[1].equals(“CheckIsVote“)){
if(ServerUI.isStartVote)
res

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????????301??2013-06-03?13:17??投票app\VotorServerModule\.classpath

?????文件????????393??2013-06-03?13:17??投票app\VotorServerModule\.project

?????文件????????598??2013-06-03?13:17??投票app\VotorServerModule\.settings\org.eclipse.jdt.core.prefs

?????文件???????4557??2013-06-08?15:44??投票app\VotorServerModule\bin\Server\ServerThread.class

?????文件???????2961??2013-06-08?15:38??投票app\VotorServerModule\bin\Server\ServerUI.class

?????文件??????16193??2013-06-08?15:46??投票app\VotorServerModule\hs_err_pid2136.log

?????文件??????14319??2013-06-08?15:00??投票app\VotorServerModule\hs_err_pid3696.log

?????文件??????16122??2013-06-08?15:21??投票app\VotorServerModule\hs_err_pid6200.log

?????文件???????3127??2013-06-08?15:43??投票app\VotorServerModule\src\Server\ServerThread.java

?????文件???????2345??2013-06-08?15:38??投票app\VotorServerModule\src\Server\ServerUI.java

?????文件????????364??2013-06-03?13:33??投票app\VotorStudentModule\.classpath

?????文件????????854??2013-06-03?13:32??投票app\VotorStudentModule\.project

?????文件????????177??2013-06-03?13:33??投票app\VotorStudentModule\.settings\org.eclipse.jdt.core.prefs

?????文件????????874??2013-06-03?19:01??投票app\VotorStudentModule\AndroidManifest.xml

?????文件????????874??2013-06-06?09:07??投票app\VotorStudentModule\bin\AndroidManifest.xml

?????文件????????369??2013-06-08?09:13??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\BuildConfig.class

?????文件???????3727??2013-06-08?09:13??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\MainActivity.class

?????文件????????376??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$attr.class

?????文件????????443??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$drawable.class

?????文件????????521??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$id.class

?????文件????????439??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$layout.class

?????文件????????433??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$menu.class

?????文件????????577??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$string.class

?????文件????????467??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R$style.class

?????文件????????733??2013-06-08?12:02??投票app\VotorStudentModule\bin\classes\com\example\votorstudentmodule\R.class

?????文件?????443944??2013-06-05?17:02??投票app\VotorStudentModule\bin\classes.dex

?????文件?????149766??2013-06-03?14:02??投票app\VotorStudentModule\bin\dexedLibs\android-support-v4-a4602d2945a31496c7c2b8f364e8d98f.jar

?????文件????????119??2013-06-08?12:01??投票app\VotorStudentModule\bin\jarlist.cache

?????文件???????6299??2013-06-03?14:01??投票app\VotorStudentModule\bin\res\drawable-hdpi\ic_launcher.png

?????文件???????2171??2013-06-03?14:01??投票app\VotorStudentModule\bin\res\drawable-ldpi\ic_launcher.png

............此處省略152個文件信息

評論

共有 條評論