好像必须要先读入才能操作啊。关注

解决方案 »

  1.   

    但是读到内存中,如果文件很大的话,这样操作不是很费时间?
      

  2.   

    ContactBook admindsContact =new ContactBook();
    admindsContact.ReadXml(this.Account.PublicData + "ContactBook.xml");
    DataView dvContact = admindsContact.Contact.DefaultView;
    dvContact.RowFilter ="ContactID=" + AdmincontactID ;
    if(dvContact.Count  >0)
    {
    DataRowView  row =dvContact[0]; this.txtName.Text  = row["Name"].ToString().Trim() ;
    this.txtEMail.Text  = row["EMail"].ToString().Trim();
    this.txtCompany.Text     = row["Company"].ToString().Trim() ;  
    this.txtTel_Firm.Text    = row["Tel_Firm"].ToString().Trim() ;
    this.txtMobile.Text      = row["Mobile"].ToString().Trim(); 
    this.txtTel_Home.Text    = row["Tel_Home"].ToString ().Trim();
    this.txtQICQ.Text        = row["OICQ"].ToString().Trim();
    this.txtAddress.Text     = row["Address"].ToString ().Trim();
    this.txtPostalcode.Text  = row["Postalcode"].ToString().Trim();
    this.txtHomePage.Text    = row["HomePage"].ToString().Trim();
    this.txtFax.Text         = row["Fax"].ToString().Trim(); 
    this.txtAlial.Text       = row["Alias"].ToString().Trim();
    //时间
      

  3.   

    哎,也许只能等到将来某一天才能实现了,结贴。