本文整理汇总了C#中Contact.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Contact.GetType方法的具体用法?C# Contact.GetType怎么用?C# Contact.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
private void btnSubmit_Click(object sender, EventArgs e)
{
//string xml;
Contact contact = new Contact();
contact.companyName = txtCompany.Text;
contact.firstName = txtFName.Text;
contact.middleName = txtMName.Text;
contact.lastName = txtLName.Text;
contact.liscence = txtLicense.Text;
contact.phone = txtPhone.Text;
contact.cell = txtCell.Text;
contact.email = txtEmail.Text;
contact.buildingLiscence = txtBuildingLicense.Text;
contact.streetNumber = txtStreetNumber.Text;
contact.streetName = txtStreetName.Text;
contact.type = txtType.Text;
contact.streetName2 = txtStreetName2.Text;
contact.city = txtCity.Text;
contact.state = txtState.Text;
contact.zip = txtZip.Text;
System.IO.StreamWriter file = new System.IO.StreamWriter(@"Contact.xml");
System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(contact.GetType());
x.Serialize(file, contact);
file.Close();
}