按你的意思是插上U盘自动复制,这样就需要一个时间控件来不断检测,是不是有可移动磁盘,如果有,则复制,我把主要的工作做一下,代码如下:
Private
Declare
Function
GetDriveType
Lib
"kernel32"
Alias
"GetDriveTypeA"
(ByVal
nDrive
As
String)
As
Long
Private
Sub
Timer1_Timer()
Dim
i
As
Long,
hui
As
Long
For
i
=
Asc("A")
To
Asc("Z")'从盘符A到盘符Z检测,看是不是移动磁盘
hui
=
GetDriveType(Trim(Chr(i))
&
":")
If
hui
=
2
Then'移动磁盘的返回值是2
Timer1Enabled
=
False'停止时间控件,避免重复复制。你具体做的时候,可以加入其它检测,时间控件不能停止,否则再插入U盘就不会自动复制了。比如加入一个字符串或数组,正在复制的做个标志,每次检测循环的时候可以检测标志的数组,如果标志数组不是移动磁盘,说明磁盘已经拔掉,改回标志,下次插入还会复制。
Shell
"cmdexe
/c
xcopy
"
&
Chr(i)
&
":\
D:\qbh
/V/C/I/H/K/Y/E",
6'复制文件到d:\qbh文件夹下,可以根据需要具体设置,楼上的Jackiejor兄后面的参数是vbhide,那样有没有复制完,你并不知道。而且没有加参数E,没有这个参数,不会复制文件夹。
End
If
Next
i
End
Sub
采纳哦#include <iostream>
#include <cstring>
using namespace std;
int cha(char x[],char sheng[][20]) {
int i;
char flg = 1;
for(i = 0;i < 34;i++)
if(strcmp(x,sheng[i]) == 0) return i;
return 0;
}
int main() {
char sheng[34][20] = {"北京","天津","上海","重庆","河北","山西","辽宁",
"吉林","黑龙江","江苏","浙江","安徽","福建","江西","山东","河南",
"湖北","湖南","广东","海南","四川","贵州","云南","陕西","甘肃",
"青海","西藏自治区","广西壮族自治区","内蒙古自治区","宁夏回族自治区",
"新疆维吾尔自治区","香港","澳门","台湾"
};
char hui[34][20] = {"无明确省会","无明确省会","无明确省会","无明确省会",
"石家庄","太原","沈阳","长春","哈尔滨","南京","杭州","合肥","福州",
"南昌","济南","郑州","武汉","长沙","广州","海口","成都","贵阳","昆明",
"西安","兰州","西宁","拉萨","南宁","呼和浩特","银川","乌鲁木齐",
"无明确省会","无明确省会","台北"
};
char x[20];
int index;
cout << "请输入省份:";
cin >> x;
index = cha(x,sheng);
if(index >= 0) printf("%s : %s\n",x,hui[index]);
system("pause");
return 0;
}flash as30全屏代码如下:(其中之一即可)
stagedisplayState = StageDisplayStateFULL_SCREEN;//全屏显示
stagescaleMode = StageScaleModeSHOW_ALL;//显示所有,不保证比例
= StageScaleModeEXACT_FIT;//锁定比例显示
= StageScaleModeNO_BORDER;//填满显示区域,并保证比例
= StageScaleModeNO_SCALE;//原始大小
将全屏代码写在flash的第一帧的帧代码上即可实现全屏效果。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)