⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setks.java

📁 一个手机上的考试系统的有服务器源码
💻 JAVA
字号:
/* * Author :  胡家宝 * Date   :  2006-6-30 10:54:53 */  package WebExam;  import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.*; public class Setks{	private int m_ks_id;	private int m_clerk_kscj_ID;	private int m_tk_tkj_Id;	private int m_tm_Id;	private String m_tm_zy;	private String m_tm_tx;	private String m_tm_nr;	private float m_tm_fs;	private String m_tm_nd;	private String m_tm_zsd;	private String m_tm_da;	private int m_tm_dasm;	private String m_tm_bzda;	private int m_ImageType;	private String m_FileName;	private String m_Fileext;	private int m_Filesize;	// Image can't auto deal :  Image filed image nIndex = 18	public Setks()	{	}	public Setks(int ks_id,int clerk_kscj_ID,int tk_tkj_Id,int tm_Id,String tm_zy,String tm_tx,String tm_nr,float tm_fs,String tm_nd,String tm_zsd,String tm_da,int tm_dasm,String tm_bzda,int ImageType,String FileName,String Fileext,int Filesize)	{		m_ks_id = ks_id;		m_clerk_kscj_ID = clerk_kscj_ID;		m_tk_tkj_Id = tk_tkj_Id;		m_tm_Id = tm_Id;		m_tm_zy = tm_zy;		m_tm_tx = tm_tx;		m_tm_nr = tm_nr;		m_tm_fs = tm_fs;		m_tm_nd = tm_nd;		m_tm_zsd = tm_zsd;		m_tm_da = tm_da;		m_tm_dasm = tm_dasm;		m_tm_bzda = tm_bzda;		m_ImageType = ImageType;		m_FileName = FileName;		m_Fileext = Fileext;		m_Filesize = Filesize;	}	public int getks_id()	{		return m_ks_id;	}	public void setks_id( int ks_id  )	{		m_ks_id = ks_id;	}	public int getclerk_kscj_ID()	{		return m_clerk_kscj_ID;	}	public void setclerk_kscj_ID( int clerk_kscj_ID  )	{		m_clerk_kscj_ID = clerk_kscj_ID;	}	public int gettk_tkj_Id()	{		return m_tk_tkj_Id;	}	public void settk_tkj_Id( int tk_tkj_Id  )	{		m_tk_tkj_Id = tk_tkj_Id;	}	public int gettm_Id()	{		return m_tm_Id;	}	public void settm_Id( int tm_Id  )	{		m_tm_Id = tm_Id;	}	public String gettm_zy()	{		return m_tm_zy;	}	public void settm_zy( String tm_zy  )	{	if( tm_zy == null )			tm_zy= "default";		m_tm_zy = tm_zy;	}	public String gettm_tx()	{		return m_tm_tx;	}	public void settm_tx( String tm_tx  )	{	if( tm_tx == null )			tm_tx= "default";		m_tm_tx = tm_tx;	}	public String gettm_nr()	{		return m_tm_nr;	}	public void settm_nr( String tm_nr  )	{	if( tm_nr == null )			tm_nr= "default";		m_tm_nr = tm_nr;	}	public float gettm_fs()	{		return m_tm_fs;	}	public void settm_fs( float tm_fs  )	{		m_tm_fs = tm_fs;	}	public String gettm_nd()	{		return m_tm_nd;	}	public void settm_nd( String tm_nd  )	{	if( tm_nd == null )			tm_nd= "default";		m_tm_nd = tm_nd;	}	public String gettm_zsd()	{		return m_tm_zsd;	}	public void settm_zsd( String tm_zsd  )	{	if( tm_zsd == null )			tm_zsd= "default";		m_tm_zsd = tm_zsd;	}	public String gettm_da()	{		return m_tm_da;	}	public void settm_da( String tm_da  )	{	if( tm_da == null )			tm_da= "default";		m_tm_da = tm_da;	}	public int gettm_dasm()	{		return m_tm_dasm;	}	public void settm_dasm( int tm_dasm  )	{		m_tm_dasm = tm_dasm;	}	public String gettm_bzda()	{		return m_tm_bzda;	}	public void settm_bzda( String tm_bzda  )	{	if( tm_bzda == null )			tm_bzda= "default";		m_tm_bzda = tm_bzda;	}	public int getImageType()	{		return m_ImageType;	}	public void setImageType( int ImageType  )	{		m_ImageType = ImageType;	}	public String getFileName()	{		return m_FileName;	}	public void setFileName( String FileName  )	{	if( FileName == null )			FileName= "default";		m_FileName = FileName;	}	public String getFileext()	{		return m_Fileext;	}	public void setFileext( String Fileext  )	{	if( Fileext == null )			Fileext= "default";		m_Fileext = Fileext;	}	public int getFilesize()	{		return m_Filesize;	}	public void setFilesize( int Filesize  )	{		m_Filesize = Filesize;	}	//序列化	public byte[] serialize() throws IOException	{		ByteArrayOutputStream bout = new ByteArrayOutputStream();		DataOutputStream dout = new DataOutputStream(bout);		dout.writeInt( m_ks_id );		dout.writeInt( m_clerk_kscj_ID );		dout.writeInt( m_tk_tkj_Id );		dout.writeInt( m_tm_Id );		dout.writeUTF( m_tm_zy );		dout.writeUTF( m_tm_tx );		dout.writeUTF( m_tm_nr );		dout.writeFloat( m_tm_fs );		dout.writeUTF( m_tm_nd );		dout.writeUTF( m_tm_zsd );		dout.writeUTF( m_tm_da );		dout.writeInt( m_tm_dasm );		dout.writeUTF( m_tm_bzda );		dout.writeInt( m_ImageType );		dout.writeUTF( m_FileName );		dout.writeUTF( m_Fileext );		dout.writeInt( m_Filesize );		return bout.toByteArray();	}	//反序列化	public  void  deserialize(byte[] data) throws IOException	{		ByteArrayInputStream bin = new ByteArrayInputStream(data);		DataInputStream din = new DataInputStream(bin);		m_ks_id = din.readInt();		m_clerk_kscj_ID = din.readInt();		m_tk_tkj_Id = din.readInt();		m_tm_Id = din.readInt();		m_tm_zy = din.readUTF();		m_tm_tx = din.readUTF();		m_tm_nr = din.readUTF();		m_tm_fs = din.readFloat();		m_tm_nd = din.readUTF();		m_tm_zsd = din.readUTF();		m_tm_da = din.readUTF();		m_tm_dasm = din.readInt();		m_tm_bzda = din.readUTF();		m_ImageType = din.readInt();		m_FileName = din.readUTF();		m_Fileext = din.readUTF();		m_Filesize = din.readInt();		bin.close();		din.close();	}	public static boolean matches(byte[] data, String userName) throws IOException  	{ 		ByteArrayInputStream bais = new ByteArrayInputStream(data); 		DataInputStream dis = new DataInputStream(bais); 		try 		{ 			return (dis.readUTF()).equals(userName); 		} 		catch (IOException e) 		{ 			e.printStackTrace(); 			return false; 		} 	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -