ÀûÓöÌÐÅè·¢ËͶÌÐŵÄJava´úÂë
Ç°Ò»¶ÎÐèÒªÓöÌÐÅè·¢ËͶÌÐÅ£¬Ð´ÁËÒ»¶Î¶ÌÐÅè·¢ËͶÌÐŵĴúÂ룺
import javax.comm.*;
import java.util.*;
import java.io.*;
import org.smslib.*;
public class smsModem
{
private static LinkedList<COutgoingMessage> msgList = new LinkedList<COutgoingMessage>();
private static String com="";
private static int baudRate=0;
private static CService srv;
private static boolean isSending=false;
private static void testAndSetCom()
/**
Try to find out which com port is used by modem and the work baudrate.
*/
{
CommPortIdentifier portId;
Enumeration portList;
//int bauds[] = { 9600, 19200, 38400, 115200 };
int bauds[]={38400, 115200};
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements())
{
portId = (CommPortIdentifier) portList.nextElement();
System.out.println("PORTID:"+portId);
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
{
System.out.println("Found port: " + portId.getName());
for (int i = 0; i < bauds.len
Ïà¹ØÎĵµ£º
JavaʹÓÃÁ½ÖÖ·½·¨À´´¦Àí¶àÏß³Ì
µÚÒ»ÖÖÊÇ×ÓÀ໯Thread¶ÔÏó¡£ Thread¶ÔÏóÊÇJavaÌṩµÄ·â×°Ï̵߳ĶÔÏó¡£Èç¹û×ÓÀ໯ThreadÀ࣬Ôò±ØÐëÖØÔØÕâ¸öÀàÖеÄrun·½·¨ÒÔÌṩÓÉÕâ¸öÌØÊâÏß³ÌÖ´ÐеĴúÂë¡£ÒòΪJava²»Ö§³Ö¶àÖؼ̳У¬ËùÒÔÈç¹ûÄãµÄÀàÐèÒª×ÓÀ໯ÁíÒ»¸öÀ࣬ÄÇô¾Í²»ÄÜ×ÓÀ໯Thread¶ÔÏó¡£
µÚ¶þÖÖÊÇʵÏÖÓÉJavaÌṩµÄRunnable ......
Java½Ó¿Ú×Ô¼º²¢²»×öʵ¼ÊµÄ¹¤×÷£¬ËüΪ×îÖÕ×öÕâЩ¹¤×÷µÄ·½·¨Ö¸¶¨ÔÐÍ¡£½Ó¿ÚµÄÃû×ÖÒ»°ãÒÔable½á⣬Ãû×ÖÆäËûµÄ²¿·Ö˵Ã÷ËüÈçºÎ¹¤×÷¡£
µ±ÊµÏÖÒ»¸ö½Ó¿Úʱ£¬±ØÐë°üº¬½Ó¿ÚÒªÇóµÄ·½·¨¡£¶ÔRunnableÀ´Ëµ£¬±ØÐë°üº¬run·½·¨¡£ ......
ÒÔÏÂÊÇÐèÒª»ñµÃÅäÖÃÎļþµÄÀ࣬ÆäÖлñµÃ /config.properties ÎļþµÄÊý¾Ý
package com.chinacache.boss.queryservice.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.log4j.Logger;
public final class ConfigConstant {
static Logger logg ......
Ò»¡¢·´ÉäµÄ¸ÅÄî £º
·´ÉäµÄ¸ÅÄîÊÇÓÉSmithÔÚ1982ÄêÊ×´ÎÌá³öµÄ£¬Ö÷ÒªÊÇÖ¸³ÌÐò¿ÉÒÔ·ÃÎÊ¡¢¼ì²âºÍÐÞ¸ÄËü±¾Éí״̬»òÐÐΪµÄÒ»ÖÖÄÜÁ¦¡£ÕâÒ»¸ÅÄîµÄÌá³öºÜ¿ìÒý·¢Á˼ÆËã»ú¿ÆѧÁìÓò¹ØÓÚÓ¦Ó÷´ÉäÐÔµÄÑо¿¡£ËüÊ×Ïȱ»³ÌÐòÓïÑÔµÄÉè¼ÆÁìÓòËù²ÉÓÃ,²¢ÔÚLispºÍÃæÏò¶ÔÏó·½ÃæÈ¡µÃÁ˳ɼ¨¡£ÆäÖÐLEAD/LEAD++ ¡¢OpenC++ ¡¢MetaXaºÍOpenJavaµÈ¾ÍÊ ......