定时调度https地址

复制代码
class Program
{
    static void Main(string[] args)
    {
        while (true)
        {
            try
            {
                // ./nssm install LifeManager.Timing
                // sc delete LifeManager.Timing
                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback((a,b,c,d)=>
                {
                    return true;
                });
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                WebClient webClient = new WebClient();
                var resBytes = webClient.DownloadData("https://life.dongbencq.com/api/WX/GetUser?code=123");
                Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}]" + Encoding.UTF8.GetString(resBytes));
            }
            catch (Exception ex)
            {
                Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss")}]" + ex.Message);
            }
            Thread.Sleep(1000 * 60 * 2);
        }
    }
}
复制代码

定时调度,地址是https地址。

posted @   段江涛IT  阅读(26)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
历史上的今天:
2019-07-08 一步一步搭建Nuget私服
页脚HTML代码
点击右上角即可分享
微信分享提示