我有一个用C#.ASMX编写的小型Web服务。每次调用Web方法时,都需要单击该方法才能运行。有没有一种方法可以自动调用它而无需任何手动点击?
到目前为止,此Web服务托管在我的本地计算机中。除了IIS,您能建议一种更好的托管方式吗?我可以制作一个.exe文件并使用命令行或任务计划程序来运行我的Web服务吗?
protected OracleConnection con;
protected List<int> file_ids = new List<int>();
protected int file_id2;
protected string queryString;
protected OracleCommand cmd;
protected OracleDataReader dtr;
protected byte[] g_file = new byte[0];
protected string file_name;
protected ClientContext ctx;
public WebService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public void StartProcess()
{
var startTimeSpan = TimeSpan.Zero;
var periodTimeSpan = TimeSpan.FromSeconds(30);
var timer = new System.Threading.Timer((e) =>
{
GetCredentials();
}, null, startTimeSpan, periodTimeSpan);
}