Delphi学习笔记 – 写个关闭共享的小程序,熟悉一下基本操作
计算机的东西真的太多了,学不过来,而我却喜欢什么都学。暑假里学过一些Delphi,回学校后因为前一个月没带电脑又没学。后一个月(10月)有了笔记本,可是因为学校开设的课程里有Linux,所以一直在学Linux,还有就是浙江黑盟的建设。真是忙不过来了,现在我打算重新开始学习Delphi,接下来的学习以LINUX和Delphi为主,乱七八糟的对以后工作用处不大的就暂且不学了。

源代码很简单:
var
Form1: TForm1;
hqw21:string;
implementation
{$R *.dfm}
procedure TForm1.DriveComboBox1Change(Sender: TObject);
begin
if disksize(ord(drivecombobox1.drive)-$40)=-1 then //为什么要减40,因为disksize的原型是:function disksize(drive;byte):int64。把整形的64转为16进制就是40。
label1.Caption:='磁盘'+drivecombobox1.Drive +':没有准备好'
else
label1.Caption:='磁盘'+drivecombobox1.drive+':已经准备好';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
hqw21:='net share '+ drivecombobox1.drive+'$ /del';
//showmessage(pchar(hqw21));
winexec(pchar(hqw21),sw_hide);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
hqw21:='net share '+ drivecombobox1.drive+'$ /del';
memo1.Lines.Add(hqw21);
memo1.Lines.SaveToFile('hqw.bat');
end;
end.
既然来了,就写两句吧~
好好学习,确实要科学分析才能真正了解这个东西的,收藏一下。谢谢版主。...