代码简化
本帖最后由 bingxing8000 于 2011-2-11 11:05 编辑Dim $c1,$c2,$c3
$c1 = DriveSpaceFree( "c:\" ) ;c盘剩余空间
$c2 = DriveSpaceTotal( "c:\" )
$c3=$c1/$c2*100
MsgBox(0,"c盘剩余空间",$c3& "%" )
以上代码可以简化吗?
就是说只设一个变量就可以得出 C盘剩余的百分比 MsgBox(0,"c盘剩余空间",DriveSpaceFree("c:\")/DriveSpaceTotal( "c:\" )*100 & "%" ) MsgBox(0,"c盘剩余空间", string(DriveSpaceFree( "c:\" ) / DriveSpaceTotal( "c:\" ) *100) & "%" ) MsgBox(0,"c盘剩余空间",DriveSpaceFree("c:\")/DriveSpaceTotal( "c:\" )*100 & "%" )
{:face (411):} 学习了很不错的 MsgBox(0,"c盘剩余空间", string(DriveSpaceFree( "c:\" ) / DriveSpaceTotal( "c:\" ) *100) & "%" ){:face (427):} MsgBox(0,"c盘剩余空间", String(Round(DriveSpaceFree( "c:\" ) / DriveSpaceTotal( "c:\" ) *100,3 )) & "%" ) 谢谢大家了~!!
页:
[1]