- //设置combobox中显示未用的驱动盘号
- DWORD drives=GetLogicalDrives();
- int count ;
- unsigned int a=0x0001;
- if((drives&a)==0){
- ui->comboBox->addItem("A:","");
- }
- for(count=0;count<25;count++){
- if((drives&(a<<=1))==0){
- QString num=QString(char(66+count));
- num.operator +=(":");
- const QString num1=num;
- ui->comboBox->addItem(num1,"");
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/130620134005.html
来源: http://www.codesnippet.cn/detail/130620134005.html