是一个手机功能的模拟程序

源代码在线查看: com.pas

软件大小: 14631 K
上传用户: myhpgnl
关键词: 手机功能 模拟 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				unit com;
				
				interface
				
				uses Messages,classes,sysutils,Windows,mmsystem;
				
				var
				  COMM:string;
				  BaudRate:string;
				
				  procedure ReadRegValue;
				  procedure WriteRegValue;
				
				implementation
				
				uses registry;
				
				procedure ReadRegValue;
				var  Reg:TReginiFile;
				begin
				  reg:=TRegIniFile.Create('PCSYN');
				  Reg.RootKey:=HKEY_LOCAL_MACHINE;
				  try
				    if Reg.OpenKey('\SOFTWARE\MobileInnovation',True) then
				    begin
				      COMM:='COM'+reg.ReadString('PCSYN','COM','1');
				      BaudRate:=reg.ReadString('PCSYN','BaudRate','115200');
				    end else
				      Raise Exception.Create('软件未正确安装!');
				  finally
				    Reg.Free;
				  end;
				end;
				
				procedure WriteRegValue;
				var  Reg:TReginiFile;
				    tempcom:string;
				begin
				  reg:=TRegIniFile.Create('PCSYN');
				  Reg.RootKey:=HKey_Local_Machine;
				  try
				    if Reg.OpenKey('\SOFTWARE\MobileInnovation',True) then
				    begin
				      tempcom:=COMM;
				      delete(tempcom,1,3);
				      reg.WriteString('PCSYN','COM',tempcom);
				      reg.WriteString('PCSYN','BaudRate',BaudRate);
				    end else
				      Raise Exception.Create('软件未正确安装!');
				  finally
				    Reg.Free;
				  end;
				end;
				
				
				initialization
				  ReadRegValue;
				  WriteRegValue;
				finalization
				  WriteRegValue;
				end.
							

相关资源