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

📄 reginfor.pas

📁 絮语2007视频聊天软件源程序.仅供参考
💻 PAS
字号:
unit reginfor;

interface

uses

  Windows,Sysutils,inifiles,registry,graphics,dialogs;

  procedure readini;
  procedure writeini;
  procedure Reg_autorun;

implementation
uses udpcores,shareunit,richunt;

//------------------------------------------------------------------------------
// 读INI配置文件
//------------------------------------------------------------------------------
procedure readini;
var filenames:string;
begin
filenames:=extractfilepath(application_name)+'dat\message.txt';
if fileexists(filenames) then msgmemo.LoadFromFile(filenames);
filenames:= extractfilepath(application_name)+'dat\basepic.txt';
if fileexists(filenames) then facelist.LoadFromFile(filenames);
filenames:= extractfilepath(application_name)+'dat\charpic.txt';
if fileexists(filenames) then charlist.LoadFromFile(filenames);

filenames:=changefileext(application_name,'.ini');
if fileexists(filenames) then
   with tinifile.Create(filenames) do
     try
     core_port:=readinteger('information','core_port',6810);
     loginuser:=ReadString('information','lastloginuser','');
     loginpass:=readstring('information','autologinpwd','');
     skinindex:=readinteger('information','skincolor',0);
     skinclarity:=readinteger('information','skinclarity',250);
//------------------------------------------------------------------------------
     showonline:=readbool('information','showonline',false);
     showupdownhint:=readbool('information','showupdownhint',false);
     showmyicon:=readbool('information','showmyicon',false);
     autopath:=readstring('information','path','');
//------------------------------------------------------------------------------
     newmsg_popup:=readbool('information','newmsgpopup',false);
     pressenter_send:=readbool('information','fastsend',false);
     starting_mini:=readbool('information','runmini',false);
     newmsg_sound:=readbool('information','sound',true);
     playsound_pc:=readbool('information','pcsound',false);
     file_supervention:=ReadBool('information','sendmini',false);
     autoaccept_file:=ReadBool('information','autorev',true);
     winstart_run:=readbool('information','autorun',false);
     sidehide:=readbool('information','sidehide',false);
     closetomin:=readbool('information','closetomin',false);
     newpictext_ok:=readbool('information','newpictext',false);
     auto_status:=readinteger('information','auto_status',1);
     login_hide:=readbool('information','login_hide',false);
     status_outtime:=readinteger('information','status_outtime',5);
     allow_auto_status:=readbool('information','allow_auto_status',false);
     systemhot_key:=readinteger('information','systemkey',0);
     bosshot_key:=readinteger('information','bosskey',0);
     video_index:=readinteger('information','video_index',0);
     audio_index:=readinteger('information','audio_index',0);
     mic_index:=readinteger('information','mic_index',0);
//------------------------------------------------------------------------------
     autopath:=readstring('information','autopath','c:\');
     revertmsg:=readstring('information','revertmsg','');
     playsound_code:=readstring('information','pcmusice','');
     playwave_code:=ReadString('information','filewave','');
     udpcore.myfont.font.Name:=readstring('information','fontname','宋体');
     udpcore.myfont.font.size:=readinteger('information','fontsize',9);
     udpcore.myfont.font.color:=stringtocolor(readstring('information','fontcolor','clblack'));
     udpcore.myfont.font.style:=enstyle(readstring('information','fontstyle','0000'));

     finally
     free;
     end;


end;

//------------------------------------------------------------------------------
// 写INI配置文件
//------------------------------------------------------------------------------
procedure writeini;
var filenames:string;
begin
searchiplist.SaveToFile(extractfilepath(application_name)+'dat\iplist.txt');
msgmemo.savetofile(extractfilepath(application_name)+'dat\message.txt');
logmemo.savetofile(extractfilepath(application_name)+'log.txt');

filenames:=changefileext(application_name,'.ini');
with tinifile.create(filenames) do
  try
  EraseSection('information');
  writeinteger('information','core_port',core_port);
  writestring('information','lastloginuser',loginuser);
  writestring('information','autologinpwd',loginpass);
  writeinteger('information','skincolor',skinindex);
  writeinteger('information','skinclarity',skinclarity);
  writebool('information','showonline',showonline);
  writebool('information','showmyicon',showmyicon);
  writebool('information','showupdownhint',showupdownhint);
  writebool('information','sound',newmsg_sound);
  writebool('information','pcsound',playsound_pc);
  writebool('information','autorun',winstart_run);
  writebool('information','autorev',autoaccept_file);
  writebool('information','runmini',starting_mini);
  writebool('information','newmsgpopup',newmsg_popup);
  WriteBool('information','fastsend',pressenter_send);
  WriteBool('information','closetomin',closetomin);
  writebool('information','sendmini',file_supervention);
  writebool('information','sidehide',sidehide);
  writebool('information','newpictext',newpictext_ok);
  writebool('information','login_hide',login_hide);
  writebool('information','allow_auto_status',allow_auto_status);
  writeinteger('information','auto_status',auto_status);
  writeinteger('information','status_outtime',status_outtime);
  writeinteger('information','systemkey',systemhot_key);
  writeinteger('information','bosskey',bosshot_key);
  writeinteger('information','video_index',video_index);
  writeinteger('information','audio_index',audio_index);
  writeinteger('information','mic_index',mic_index);
//------------------------------------------------------------------------------
  writestring('information','autopath',autopath);
  writestring('information','filewave',playwave_code);
  writestring('information','pcmusice',playsound_code);
  writestring('information','revertmsg',revertmsg);
  writestring('information','fontname',udpcore.myfont.font.Name);
  writeinteger('information','fontsize',udpcore.myfont.font.size);
  writestring('information','fontcolor',colortostring(udpcore.myfont.font.color));
  writestring('information','fontstyle',destyle(udpcore.myfont.font.style));
  finally
  free;
  end;
end;

//------------------------------------------------------------------------------
// 将自动运行写入 windows 注册表
//------------------------------------------------------------------------------
procedure Reg_autorun;
var reg:tregistry;
begin
reg:=tregistry.Create;
try
reg.RootKey:=hkey_local_machine;
reg.openkey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',true);
if reg.ValueExists('xychat') then reg.DeleteValue('xychat');
if winstart_run then reg.WriteString('xychat',application_name);
finally
reg.CloseKey;
reg.free;
end;
end;



end.

⌨️ 快捷键说明

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