小弟程序如下:各位大哥帮忙看看啊。。。
import java.io.*;
import java.util.*;
import javax.comm.*;
public class main1
{
static Enumeration portList;
static CommPortIdentifier portId;
static SerialPort serialPort;
static OutputStream outputStream;
static InputStream inputStream;
static char c34;
static char c26 = '\032 ';
static String s1 = "AT+CMGS=13889530147\n ";
static String s2= "AT+CMGF=1\n ";
static String s3= "AT+CMGS=13889530147\n ";
static String s4= "hello "+ '\032 '+ "\n ";
public main1() {}
public static void main(String args[])
{
try
{
CommPortIdentifier commportidentifier = CommPortIdentifier.getPortIdentifier( "COM0 ");
serialPort = (SerialPort)commportidentifier.open( "smsapp ", 3000);
outputStream = serialPort.getOutputStream();
inputStream = serialPort.getInputStream();
serialPort.setSerialPortParams(9600,