如何在每天的特定时间自动播放嵌入音频? [英] How to autoplay embed audio in a Specific time , daily ?

查看:76
本文介绍了如何在每天的特定时间自动播放嵌入音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问如何在每天的特定时间内自动播放嵌入音频? ,我希望它在用户未设置的程序中修复。

谢谢,

I'm asking how to autoplay embed audio in a Specific time daily ? , i want it be fixed in the program not set by the user .
thanks ,

推荐答案

您可以尝试使用此代码段。另外在main方法中使用myTimer.Start()方法启动计时器。每次执行后,如果需要,您也可以重置计时器。



You can try to use this snippet. Also in your main method use myTimer.Start() method to start the timer. After every execution you can reset the timer as well if required.

System.Timers.Timer myTimer = new System.Timers.Timer();
myTimer.Elapsed += new ElapsedEventHandler(OnTimer);
myTimer.Interval = 1000; //Means 1 second
myTimer.Enabled = true;

public void OnTimer(object source, ElapsedEventArgs e )
{
    //Your code here
}





如果它解决了你的问题,请给它评分。



Rate it if it solves your problem.


这篇关于如何在每天的特定时间自动播放嵌入音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆