2012年10月23日
摘要: private void button1_Click(object sender, EventArgs e) { XDocument dow = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), new XElement("person", new XElement("age",12345))); dow.Save(Application.StartupPath + "\\my.xml"); MessageBox. 阅读全文
posted @ 2012-10-23 13:04 潴潴黠 阅读(160) 评论(0) 推荐(0) 编辑
  2012年9月28日
摘要: Form2 f2; Form3 f3; private void btnMessageType_Click(object sender, EventArgs e) { this.panel_main.Controls.Clear(); f2 = new Form2(); //实例化窗体FORM2 f2.TopLevel = false; //设置为非顶级窗体 f2.FormBorderStyle = FormBorderStyle.None... 阅读全文
posted @ 2012-09-28 18:44 潴潴黠 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 一般而言,我们用控制台承载WCF服务只需这样写就行了: //定义承载服务的类型和承载服务的基址 using (ServiceHost host = new ServiceHost(typeof(Service1), new Uri("http://localhost:8839/CalculatorService"))) { //增加一个服务终结点 host.AddServiceEndpoint(typeof(IService1), new WSHttpBinding(), "Calculat... 阅读全文
posted @ 2012-09-28 09:17 潴潴黠 阅读(506) 评论(0) 推荐(0) 编辑