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

📄 web158_com_server_config.java

📁 java socket 网上在线考试系统
💻 JAVA
字号:
package web158.com;
/**
 * @param 李建东
 * 
 * 联系电话:0898-62925341
 * 
 * 联系QQ:813751  657597  8912740
 * 
 * 网   址:
 * 			http://www.web156.com
 *			http://www.web158.com
 */
import java.awt.Font;
import java.awt.Graphics;
import java.io.*;
import javax.swing.*;
import java.awt.*;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;
class Web158_Com_Server_Config {
	
	Web158_Com_Server_Config()
	{
		
	}
	//初始化字体
	void initFont()
	{
		Font font = new  Font("宋体",0,12);  
    	UIManager.put("Label.font",  font);
    	UIManager.put("Button.font",   font);  
    	UIManager.put("OptionPane.font",   font);   
        UIManager.put("OptionPane.messageFont",   font);   
        UIManager.put("OptionPane.buttonFont",   font); 
	}
	//配置参数是否完整
	public String web158com_service_config_ok()
	{
		try
		{
			File web158_s_skin=new File("web158_com_config/info.dll");
			File web158_db_skin=new File("web158_com_config/temp.dll");
			File web158_p_skin=new File("web158_com_config/nophoto.dll");
			//位图资源文件存在返回正确
			if(!web158_s_skin.exists())
			{
				return "系统文件info.dll丢失";
			}
			if(!web158_db_skin.exists())
			{
				return "系统文件:temp.dll丢失";
			}
			if(!web158_p_skin.exists())
			{
				return "系统文件:nophoto.dll丢失";
			}
			//读取资源文件失败反回假值
			else
			{
				return "allok";
			}
		}
		catch(Exception web158_skin_no)
		{
			System.out.print(web158_skin_no.getMessage());
			return "出现了未知错误";
		}
		
	}
	//打开技术支持
	public boolean gotoWeb158_com()
	{
		File f=new File("C:\\Program Files\\Internet Explorer\\Iexplore.exe");
		// 是XP存在
		if(f.exists())
		{
			try{ 
				String command = f+" http://www.web158.com";
				Runtime.getRuntime().exec(command); 
				return true;
			}//end of try
			//出错返回
			catch(IOException ex)  
			{
				return false;
			} 
		}
		//不存在返回
		else
		{
			return false;
		}

	}
}


//系统皮肤
//窗口背景Panel
class web158_com_server_getSkin extends JPanel
{
	web158_com_server_getSkin(){
	}
	public void paintComponent(Graphics g)
	{
		int x=0;
		int y=0;
		ImageIcon im = new ImageIcon("web158_com_config/info.dll");
		while(true)
		{
			g.drawImage(im.getImage(),x,y,this);
			if(x>getSize().width&&y>getSize().height)
			break;
			if(x>getSize().width)
			{
				x=0;
				y+=im.getIconHeight();
				}
			else
			x+=im.getIconWidth();
			}
		}
}
//考生图片
class web158_com_pic extends JPanel
{
	String picurl="nophoto.dll";
	String name="nophoto.dll";
	web158_com_pic()
	{
		this.setBorder(BorderFactory.createLineBorder(new Color(255,255,255)));
	}
	//接受外来参数
	public void setPicurl(String url,String name)
	{
		this.picurl=url;
		this.name=name;
	}
	public void paintComponent(Graphics g)
	{
		File f=new File("web158_com_stupic/"+picurl);
		if(!f.exists())
		{
			picurl="nophoto.dll";
		}
		int x=0;
		int y=0;
		try
		{
		ImageIcon im = new ImageIcon("web158_com_stupic/"+picurl);
		while(true)
		{
			g.drawImage(im.getImage(),x,y,this);
			//如果是没有图片
			if(picurl.equals("nophoto.dll"))
			{
				g.setColor(new Color(120,140,150));
				g.drawString("华夏网建 ",im.getIconWidth()-70 , im.getIconHeight()-16);
			}
			else
			{
				g.setColor(new Color(0,0,0));
				g.drawString("考生:"+name,(im.getIconWidth()-name.length())/4 , im.getIconHeight()-5);
			}
			if(x>getSize().width&&y>getSize().height)
			break;
			if(x>getSize().width)
			{
				x=0;
				y+=im.getIconHeight();
				}
			else
			x+=im.getIconWidth();
			}
		}catch(Exception ef)
		{
			System.out.print("出现头象错误");
		}
	}
}


⌨️ 快捷键说明

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