Visual Basic 6.0可以通过调用API函数格式化一个磁盘,无论是软盘还是硬盘。 打开一个新的项目(工程1) ,如果你没有更改过缺省模式,那么Visual Basic 6.0会自动添加一个form1文件,在form1上添加一个命令控件,将下面的代码拷入。 Option Explicit Private Declare Function SHFormatDrive Lib"shell32"( ByVal Hend AS Long,ByVal Drive AS Long,ByVal FormatID AS Long,ByVal Options AS Long) as Long Private Sub FormatDisk(intDrive as integer,blnQuickFormat as Boolean) dim lngReturn As Long if (blnQuickFormat) then lngReturn= SHFormatDrive(0,intDrive,0&,1&) else lngReturn= SHFormatDrive(0,intDrive,0&,0&) end if end Sub Private Sub Command1_Click() call FormatDisk(0,True) End Sub 运行此程序。 注意FormatDisk函数的第一个变量很重要,他的值是0,1,2时代表格式化的分别是:A、B、C盘。
上传时间: 2015-10-05
上传用户:kytqcool
wangxiaoyong0015@yahoo.com.cn b不懂的给我发邮件!!! 谢谢啊!!一定支持我
标签: wangxiaoyong yahoo 0015 com
上传时间: 2013-12-02
上传用户:caiiicc
程序作用:测试Sage Tech.开发板(MCP300)中hd7279键盘显示芯片是否能正常工作 */ /*程序功能:按下1号键显示0、1、2、3,按下2号键显示c、d、e、f,按下3号键显示4、5、6、7 */ /* 按下4号键显示8、9、a、b,按下0号键点亮4个LED灯 */
上传时间: 2013-12-30
上传用户:Ants
基于B/S模式高校科研系统的设计与研究,基于B/S模式的高校科 研管理信息系统采用3层体系结构,利用ASP技术和SQL Server数据库系统加以设计与实现。
上传时间: 2013-12-26
上传用户:ma1301115706
交通灯控制,在A和B方向各用数码管显示剩余的时间.
上传时间: 2013-12-06
上传用户:jkhjkh1982
直线加法的实验报告 实现任意二位加法 (a+b)-(c+d)
上传时间: 2013-12-27
上传用户:gxf2016
基于b/s的网上银行服务系统的设计与开发,从数据库设计到系统的规划给出了一个清晰的方案
上传时间: 2015-10-13
上传用户:edisonfather
This I develops based on the B/S structure student managementsystem management system, hoped brings a help to the novice
标签: managementsystem management structure develops
上传时间: 2014-01-07
上传用户:钓鳌牧马
Romberg求定积分 输入:积分区间[a,b],被积函数f(x,y,z) 输出:积分结果
上传时间: 2015-10-14
上传用户:妄想演绎师
追赶法解周期性方程 输入:a[],b[],c[],x[] 输出:求解结果X在x[]中
上传时间: 2015-10-14
上传用户:thuyenvinh