封装的通用方法: using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Net; using System.Web.Services.Description; using System.CodeDom; using System.CodeDom.Compiler; using System.Reflection; namespace WindowsServ
有时候在项目中,会调用一个控制台应用程序去处理一些工作.那在我们的程序中要怎么样做才能调用一个控制台应用程序并将参数传递过去,控制台程序执行完后,我们的程序又怎样获取返回值?代码如下:调用代码: try { Process pro = new Process(); //控制台应用程序所在目录 pro.StartInfo.FileName = @"C:\U
在Winform中对数据库进行操作缺乏安全性,因而可以使用Winform调用WebService来实现对数据库的各种操作. 在VS2010中,创建一个Web服务程序,第一:创建一个空的Web应用程序,名字自己起.第二:鼠标右击刚刚创建的工程,选择添加,在弹出的框中选择Web服务,自己起好名字,确定即可,这样就创建好一个Web服务程序了. 经过上上面的步骤,我们就可以添加方法来实现数据库的操作. 代码如下: using System; using System.Collections.Generi