private CurrencyManager sourceCM;
private DataView sourceView;
this.OnlyOneAdapter.strSQL=string.Format("select ID,ShiJian,CaoZuoRen,ZhongLei,ShuLiang,QiHao,ZiHao,FangFa,ND,convert(bit,0) as DF,datareturn from T_DangAn_JiLu where LeiBie='{0}' and Flag=0 and ND='{1}' and CaoZuoRen='{2}'","文件",this.ND,this.CaoZuoRen);
this.OnlyOneAdapter.GiveMeData(out ds);
dataGrid1.SetDataBinding(ds,"Table");
sourceCM = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];
sourceView=((DataView)sourceCM.List);
sourceView.AllowNew=false;
sourceView.AllowDelete=false; private void getnetcomputername() //取局域网内的全部计算机
{
//or  use  "WinNT://your_domain_name"  
DirectoryEntry  root  =  new  DirectoryEntry("WinNT:");  
DirectoryEntries  domains  =  root.Children;  
domains.SchemaFilter.Add("domain");  
foreach  (DirectoryEntry  domain  in  domains)  
{  
string ss=domain.Name.ToString();
// if(domain.Name.ToString()==domain_name) 
// {
DirectoryEntries  computers  =  domain.Children;  
computers.SchemaFilter.Add("computer");  
foreach  (DirectoryEntry  computer  in  computers)  
{  
try
{
IPHostEntry  iphe  =  Dns.GetHostByName(computer.Name); 

foreach  (IPAddress  ip  in  iphe.AddressList)  
{  
this.LB.Items.Add(computer.Name);    
}  
DirectoryEntries  users  =  computer.Children;  
}
catch(Exception){}

// }
}  
}