📄 unit1.pas
字号:
begin
DirectoryListBox2.Directory:='c:\newstar';
end;
procedure TForm1.SpeedButton10Click(Sender: TObject);
var
i:integer;
begin
if FileListBox1.FileName<>'' then
begin
for i:=0 to filelistbox1.Items.Count-1 do
begin
if filelistbox1.Selected[i] then
begin
if i>0 then
begin
filelistbox1.Selected[i]:=false;
filelistbox1.Selected[i-1]:=true;
FileListBox1Click(nil);
DBGrid1.SetFocus;
exit;
end;
end;
end;
end;
end;
procedure TForm1.SpeedButton12Click(Sender: TObject);
var
i:integer;
begin
if FileListBox1.FileName<>'' then
begin
for i:=0 to filelistbox1.Items.Count-1 do
begin
if filelistbox1.Selected[i] then
begin
if i<(filelistbox1.Items.Count-1) then
begin
filelistbox1.Selected[i]:=false;
filelistbox1.Selected[i+1]:=true;
FileListBox1Click(nil);
DBGrid1.SetFocus;
exit;
end;
end;
end;
end;
end;
procedure TForm1.PopupMenu2Popup(Sender: TObject);
begin
if trim(ComboBox1.text)<>'' then
begin
n17.Enabled:=true;
end else
begin
n17.Enabled:=false;
end;
if trim(FileListBox1.FileName)='' then
begin
n12.Enabled:=false;
n6.Enabled:=false;
n3.Enabled:=false;
end else
begin
n12.Enabled:=true;
n6.Enabled:=true;
end;
if (trim(FileListBox1.FileName)<>'') and (trim(FileListBox2.FileName)<>'') then
begin
n3.Enabled:=true;
end else
begin
n3.Enabled:=false;
end;
end;
procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
if trim(FileListBox2.FileName)='' then
begin
n1.Enabled:=false;
n2.Enabled:=false;
n4.Enabled:=false;
n10.Enabled:=false;
popaddtoserver.Enabled:=false;
end else
begin
n1.Enabled:=true;
n2.Enabled:=true;
n4.Enabled:=true;
n10.Enabled:=true;
popaddtoserver.Enabled:=true;
end;
end;
procedure TForm1.PopupMenu4Popup(Sender: TObject);
begin
if trim(FileListBox3.FileName)='' then
begin
n23.Enabled:=false;
n36.Enabled:=false;
n37.Enabled:=false;
end else
begin
n23.Enabled:=true;
n36.Enabled:=true;
n37.Enabled:=true;
end;
end;
procedure TForm1.FileListBox3DblClick(Sender: TObject);
begin
if filelistbox3.FileName<>'' then
begin
{===========================}
if executefile(filelistbox3.FileName,'','',1)=31 then
begin
showmessage ('此文件不是可执行文件,或者它没有注册关联文档...');
screen.Cursor:=crdefault;
end;
{============================}
end;
end;
procedure TForm1.N37Click(Sender: TObject);
var
ret:integer;
i:integer;
begin
if filelistbox3.FileName<>'' then
begin
ret:=application.MessageBox(pchar('真的要删除你所选择的数据报表?, 删除后将不可恢复?'),'删除数据报表',MB_OKCANCEL+MB_DEFBUTTON2+MB_ICONQUESTION);
if ret=1 then
begin
for i:=0 to filelistbox3.Items.Count-1 do
begin
if filelistbox3.Selected[i] then
begin
// showmessage(DirectoryListBox1.Directory+'\'+filelistbox1.Items.Strings[i]);
DeleteFile(DirectoryListBox5.Directory+'\'+filelistbox3.Items.Strings[i]);
end;
end;
filelistbox3.Update;
end;
end;
end;
procedure TForm1.N23Click(Sender: TObject);
begin
FileListBox3DblClick(nil);
end;
procedure TForm1.N12Click(Sender: TObject);
begin
bkform := Tbkform.Create( Application );
try
bkform.Show;
bkform.Update;
except
end;
bkstyle.Caption:='out';
end;
procedure TForm1.N17Click(Sender: TObject);
begin
bkform := Tbkform.Create( Application );
try
bkform.Show;
bkform.Update;
except
end;
bkstyle.Caption:='in';
end;
procedure TForm1.N36Click(Sender: TObject);
var
ret:integer;
i:integer;
begin
if filelistbox3.FileName<>'' then
begin
ret:=application.MessageBox(pchar('确定要导出文件?'),'导出文件',MB_OKCANCEL+MB_DEFBUTTON2+MB_ICONQUESTION);
if ret=1 then
begin
ClientDataSet1.Close;
for i:=0 to filelistbox3.Items.Count-1 do
begin
if filelistbox3.Selected[i] then
begin
// showmessage(DirectoryListBox5.Directory+'\'+filelistbox3.Items.Strings[i]);
DeleteFile(DirectoryListBox1.Directory+'\'+filelistbox3.Items.Strings[i]);
copyfile(pchar(DirectoryListBox5.Directory+'\'+filelistbox3.Items.Strings[i]),pchar(DirectoryListBox1.Directory+'\'));
DeleteFile(DirectoryListBox5.Directory+'\'+filelistbox3.Items.Strings[i]);
end;
end;
filelistbox3.Update;
filelistbox1.Update;
end;
end;
end;
procedure TForm1.SpeedButton13Click(Sender: TObject);
begin
if trim(combobox1.Text)<>'' then
begin
setform:= Tsetform.Create( Application );
try
setform.Show;
setform.Update;
{==}
setform.combobox1.Items.Clear;
memo1.Lines.LoadFromFile('c:\newstar\Config\name1.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform.combobox1.ImageIndex[0]:=1;
{==}
memo1.Lines.LoadFromFile('c:\newstar\Config\name2.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform.combobox1.ImageIndex[1]:=1;
{==}
memo1.Lines.LoadFromFile('c:\newstar\Config\name3.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform. combobox1.ImageIndex[2]:=1;
{==}
memo1.Lines.LoadFromFile('c:\newstar\Config\name4.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform. combobox1.ImageIndex[3]:=1;
{==}
memo1.Lines.LoadFromFile('c:\newstar\Config\name5.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform. combobox1.ImageIndex[4]:=1;
{==}
memo1.Lines.LoadFromFile('c:\newstar\Config\name6.dat');
setform.combobox1.Items.Add(memo1.Lines.Text);
setform. combobox1.ImageIndex[5]:=1;
setform.combobox1.ItemIndex:=combobox1.ItemIndex;
setform.combobox1.OnChange(self);
setform.combobox1.Enabled:=false;
except
end;
//setform.show;
end;
end;
procedure TForm1.SendbtClick(Sender: TObject);
begin
if (ComboBox1.ItemIndex+1)=1 then
begin
if Uppercase(skyServer01jyLabel.Caption)='TRUE' then
begin
showmessage('系统检测到你没有此权限使用此功能!');
exit;
end;
end;
if trim(ComboBox1.Text)<>'' then
begin
with Treform.Create(Self) do
try
ShowModal;
finally
Free;
end;
end;
end;
procedure TForm1.MenuItem1Click(Sender: TObject);
begin
Toolbar971.Show;
end;
procedure TForm1.MenuItem2Click(Sender: TObject);
begin
StatusBar1.Visible:=not StatusBar1.Visible;
end;
procedure TForm1.X1Click(Sender: TObject);
begin
LMD3PaneSplitCtrl1.Splitter2.Position:=0;
end;
procedure TForm1.N40Click(Sender: TObject);
begin
LMD3PaneSplitCtrl1.Splitter2.Position:=228;
end;
procedure TForm1.MenuItem4Click(Sender: TObject);
begin
close;
end;
procedure TForm1.MenuItem7Click(Sender: TObject);
begin
SendbtClick(nil);
end;
procedure TForm1.N28Click(Sender: TObject);
begin
SpeedButton13Click(nil);
end;
procedure TForm1.N32Click(Sender: TObject);
begin
with TAboutBox.Create(Self) do
try
ShowModal;
finally
Free;
end;
end;
procedure TForm1.N26Click(Sender: TObject);
begin
ipform.show;
end;
procedure TForm1.Image7Click(Sender: TObject);
begin
N32Click(nil);
end;
procedure TForm1.InitSyaDat;
begin
try
if not fileexists('C:\NewStar\Enterpirse\user\sysuser.dat') then
begin
fileexist.Caption:='error';
exit;
end;
ClientDataSet2.Close;
ClientDataSet2.LoadFromFile('C:\NewStar\Enterpirse\user\sysuser.dat');
ClientDataSet2.Open;
ClientDataSet2.First;
while not ClientDataSet2.EOF do
begin
if ClientDataSet2.fieldbyname('local').Value=true then
begin
{===========================================================================}
nameLabel.Caption:=ClientDataSet2.fieldbyname('ycjsjm').asstring;
superLabel.Caption:=ClientDataSet2.fieldbyname('super').asstring;
localLabel.Caption:=ClientDataSet2.fieldbyname('local').asstring;
registryLabel.Caption:=ClientDataSet2.fieldbyname('registry').asstring;
hostsiteLabel.Caption:=ClientDataSet2.fieldbyname('hostsite').asstring;
ftppassLabel.Caption:=ClientDataSet2.fieldbyname('ftppass').asstring;
ftpuserLabel.Caption:=ClientDataSet2.fieldbyname('ftpuser').asstring;
datpassLabel.Caption:=ClientDataSet2.fieldbyname('datpass').asstring;
dbuserLabel.Caption:=ClientDataSet2.fieldbyname('dbuser').asstring;
dbpassLabel.Caption:=ClientDataSet2.fieldbyname('dbpass').asstring;
datuserLabel.Caption:=ClientDataSet2.fieldbyname('datuser').asstring;
skyjyLabel.Caption:=ClientDataSet2.fieldbyname('skyjy').asstring;
skyfsjyLabel.Caption:=ClientDataSet2.fieldbyname('skyfsjy').asstring;
skydqjyLabel.Caption:=ClientDataSet2.fieldbyname('skydqjy').asstring;
skyeditorjyLabel.Caption:=ClientDataSet2.fieldbyname('skyeditorjy').asstring;
skyeditorjsjyLabel.Caption:=ClientDataSet2.fieldbyname('skyeditorjsjy').asstring;
skyeditorfsjyLabel.Caption:=ClientDataSet2.fieldbyname('skyeditorfsjy').asstring;
skyeditortjjyLabel.Caption:=ClientDataSet2.fieldbyname('skyeditortjjy').asstring;
skynetjyLabel.Caption:=ClientDataSet2.fieldbyname('skynetjy').asstring;
SkyServerjyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServerjy').asstring;
SkyServer01jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer01jy').asstring;
SkyServer02jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer02jy').asstring;
SkyServer03jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer03jy').asstring;
SkyServer04jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer04jy').asstring;
SkyServer05jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer05jy').asstring;
SkyServer06jyLabel.Caption:=ClientDataSet2.fieldbyname('SkyServer06jy').asstring;
EditorServerjyLabel.Caption:=ClientDataSet2.fieldbyname('EditorServerjy').asstring;
ftpjylabel.Caption:=ClientDataSet2.fieldbyname('ftpjy').asstring;
ftpszjylabel.Caption:=ClientDataSet2.fieldbyname('ftpszjy').asstring;
ftpxjwjjjylabel.Caption:=ClientDataSet2.fieldbyname('ftpxjwjjjy').asstring;
ftpxzjylabel.Caption:=ClientDataSet2.fieldbyname('ftpxzjy').asstring;
ftpscjylabel.Caption:=ClientDataSet2.fieldbyname('ftpscjy').asstring;
sqljy.Caption:=ClientDataSet2.fieldbyname('sqljy').asstring;
nssqljy.Caption:=ClientDataSet2.fieldbyname('nssqljy').asstring;
WinArchiverjyLabel.Caption:=ClientDataSet2.fieldbyname('WinArchiverjy').asstring;
WinFtpJyLabel.Caption:=ClientDataSet2.fieldbyname('WinFtpJy').asstring;
SkyImagejyLabel.Caption:=ClientDataSet2.fieldbyname('SkyImagejy').asstring;
exit;
end;
ClientDataSet2.Next;
end;
{===========================================================================}
except
readsysdat.Caption:='error';
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
if uppercase(trim(fileexist.Caption))='ERROR' then
begin
showmessage('系统检测到本远程计算机未安装完整,请安装完整!');
close;
end;
if uppercase(trim(registryLabel.Caption))<>'TRUE' then
begin
showmessage('系统检测到本远程计算机还未注册,请注册后使用!');
close;
end;
if uppercase(trim(readsysdat.Caption))='ERROR' then
begin
showmessage('系统读取本远程计算机系统数据库出现意外错误!,请重试!');
close;
end;
if Uppercase(skyServerjyLabel.Caption)='TRUE' then
begin
showmessage('系统检测到你没有此权限使用此功能!');
close;
end;
end;
procedure TForm1.N10Click(Sender: TObject);
begin
tempp:=ExtractFilePath(dir)+'mainsql\sql.exe '+FileListBox2.FileName;
strPcopy(cmp,tempp);
winexec(cmp,1);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
form1.Caption:='报表信息接收系统-['+form1.namelabel.caption+']';
end;
procedure TForm1.sbtRreshClick(Sender: TObject);
var
i:integer;
begin
{===============ftp==========}
{FTP }
ftp.hostname:=showscreat(trim(form1.hostsiteLabel.Caption));
ftp.Password:=showscreat(trim(form1.datpassLabel.Caption));
ftp.Port:=21;
ftp.Username:=showscreat(trim(form1.datuserLabel.Caption));
StatusBar1.Panels[1].text:=' 正在试图和服务器 '+ ftp.hostname+' 进行连接...';
try
ftp.login;
ftp.getdir('.');
ftp.changedir('report/dat0'+inttostr(form1.ComboBox1.ItemIndex+1));
ftp.getdir('.');
except
StatusBar1.Panels[1].text:=' 登陆FTP服务器 '+ ftp.hostname+' 失败,请重试!!!...';
ftp.abort;
ftp.logout;
exit;
end;
memo1.Lines.Clear;
memo1.Lines.LoadFromFile(form1.DirectoryListBox3.directory+'\dat\cdx0'+inttostr(form1.ComboBox1.ItemIndex+1)+'\id.txt');
for i:=0 to memo1.Lines.Count-1 do
begin
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -