开发者

Perform a function at a specific time in VB.NET

开发者 https://www.devze.com 2022-12-24 10:29 出处:网络
I am writing a small app to automatically connect my PC to the internet at a certain time and I am using rasdial.exe for it...

I am writing a small app to automatically connect my PC to the internet at a certain time and I am using rasdial.exe for it...

Priv开发者_C百科ate Sub SetIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetIt.Click
    Dim windir As String = Environment.GetEnvironmentVariable("WINDIR")
    Shell(windir & "\system32\rasdial.exe", AppWinStyle.NormalNoFocus)
End Sub

My question is how to make the shell function run at a specified time or after a certain interval??

Also how to wake up my PC from hibernation using vb and winresume.exe


Create a console application to do the work necessary, and then use a Windows Scheduled Task to do the scheduling work for you. My answer here shows how to accomplish the scheduling.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号