请问如何取得return返回的值呀?请老师指点一下,谢谢。
                 	
                        发表在C#图书答疑
                        2010-07-15                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                                   private bool IsRegeditRun()  
{
string[] subkeyNames;
RegistryKey hkml = Registry.LocalMachine;
RegistryKey software = hkml.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"); //RegistryKey software = hkml.OpenSubKey("SOFTWARE\\test", true);
subkeyNames = software.GetValueNames(); //取得该项下所有键值的名称的序列,并传递给预定的数组中
     
foreach (string keyName in subkeyNames)
{
if (keyName == "IT部门管理系统.exe") //判断键值的名称
{
hkml.Close();
return true;
}
}
hkml.Close();
return false;
}
[font color=#FF0000]下面是在窗体加载时调用下面的内容,请问如何取得返回的值呀?[/font]
private void frm_login_Load(object sender, EventArgs e)
{
                          
if IsRegeditRun()=ture [font color=#FF0000]//此处,我该怎么写才能作到,注册表存在启动项时,checkBox2为选中状态呀?请老师指点一下,我在网上找过,没找到答案。[/font]
{
checkBox2.CheckState = CheckState.Checked;
}
                
        	
        
        
    {
string[] subkeyNames;
RegistryKey hkml = Registry.LocalMachine;
RegistryKey software = hkml.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"); //RegistryKey software = hkml.OpenSubKey("SOFTWARE\\test", true);
subkeyNames = software.GetValueNames(); //取得该项下所有键值的名称的序列,并传递给预定的数组中
foreach (string keyName in subkeyNames)
{
if (keyName == "IT部门管理系统.exe") //判断键值的名称
{
hkml.Close();
return true;
}
}
hkml.Close();
return false;
}
[font color=#FF0000]下面是在窗体加载时调用下面的内容,请问如何取得返回的值呀?[/font]
private void frm_login_Load(object sender, EventArgs e)
{
if IsRegeditRun()=ture [font color=#FF0000]//此处,我该怎么写才能作到,注册表存在启动项时,checkBox2为选中状态呀?请老师指点一下,我在网上找过,没找到答案。[/font]
{
checkBox2.CheckState = CheckState.Checked;
}

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
                







 
                     
                     
					 
						 
						 
						 
						