C#小程序问题??
using System.IO ;
using System.Windows.Forms ; //导入程序中用到的名称空间
class Recycle
{
public static void Main ( )
{
int c = 0 ; // 定义此变量主要是来判断目录中是否有文件
foreach ( string s1 in Directory.GetFiles ( "c:\\recycled" ) ) // 返回文件名称字符串行时的枚举类型
{
++c ;
}
if ( c > 0 ) //判断是否存在文件如果 c > 0则回收站有文件,反之则没有
{
DialogResult r = MessageBox.Show ( "是否确定?" , "垃圾处理!" ,
MessageBoxButtons.YesNo , MessageBoxIcon.Question ) ;
// 显示"确定"和"取消"二个按钮,图标显示是一个问号。
int ss=(int)r ;
if ( ss==6 ) // 按动确定按钮
{ foreach ( string s in Directory.GetFiles ( "c:\\recycled" ) )
// 把全路径名称房子 s中
{
File.Delete ( s ) ; //删除此文件
}
}
}
}
}
就是int ss=(int)r ;
if ( ss==6 ) // 按动确定按钮
我不太明白为什么ss==6时为按动确定按钮