定时发送功能无法获取时间!!
function YYYYMMDDstart(form,year,month,day)
{
MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
//先给年下拉框赋内容
var y = new Date().getFullYear();
for (var i = (y-3); i < (y+5); i++) //以今年为准,前30年,后30年
year.options.add(new Option(i,i));
//赋月份的下拉框
for (var i = 1; i < 13; i++)
month.options.add(new Option(i,i));
year.value = y;
month.value = new Date().getMonth() + 1;
var n = MonHead[new Date().getMonth()];
if (new Date().getMonth() ==1 && IsPinYear(year.options[year.selectedIndex].value)) n++;
writeDay(n,day); //赋日期下拉框Author:meizz
day.value = new Date().getDate();
}
function YYYYDD(str,month,day) //年发生变化时日期发生变化(主要是判断闰平年)
{
var MMvalue = month.options[month.selectedIndex].value;
if (MMvalue == "" ){ var e = day; optionsClear(e); return;}
var n = MonHead[MMvalue - 1];
if (MMvalue ==2 && IsPinYear(str)) n++;
writeDay(n,day)
}
function MMDD(str,year,day) //月发生变化时日期联动
{
var YYYYvalue = year.options[year.selectedIndex].value;
if (YYYYvalue == "" ){ var e = day; optionsClear(e); return;}
var n = MonHead[str - 1];
if (str ==2 && IsPinYear(YYYYvalue)) n++;
writeDay(n,day)
}
function writeDay(n,day) //据条件写日期的下拉框
{
var e = day; optionsClear(e);
for (var i=1; i<(n+1); i++)
e.options.add(new Option(i,i));
}
function IsPinYear(year)//判断是否闰平年
{ return(0 == year%4 && (year%100 !=0 || year%400 == 0));}
function optionsClear(e)
{
for (var i=e.options.length; i>0; i--)
e.remove(i);
}
function compDate(SY,SM,SD,EY,EM,ED)
{
}
一下为页面代码
<body onload="YYYYMMDDstart(document.form1,document.form1.SYear,document.form1.SMonth,document.form1.SDay);">
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="SYear" runat="server" name="SYear" onchange="YYYYDD(this.value,document.form1.SMonth,document.form1.SDay)" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SMonth" runat="server" name="SMonth" onchange="MMDD(this.value,document.form1.SYear,document.form1.SDay)" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SDay" runat="server" name="SDay" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SHour" runat="server" name="SHour" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SMinute" runat="server" name="SMinute" AutoPostBack="True">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label></div>
</form>
</body>
{
MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
//先给年下拉框赋内容
var y = new Date().getFullYear();
for (var i = (y-3); i < (y+5); i++) //以今年为准,前30年,后30年
year.options.add(new Option(i,i));
//赋月份的下拉框
for (var i = 1; i < 13; i++)
month.options.add(new Option(i,i));
year.value = y;
month.value = new Date().getMonth() + 1;
var n = MonHead[new Date().getMonth()];
if (new Date().getMonth() ==1 && IsPinYear(year.options[year.selectedIndex].value)) n++;
writeDay(n,day); //赋日期下拉框Author:meizz
day.value = new Date().getDate();
}
function YYYYDD(str,month,day) //年发生变化时日期发生变化(主要是判断闰平年)
{
var MMvalue = month.options[month.selectedIndex].value;
if (MMvalue == "" ){ var e = day; optionsClear(e); return;}
var n = MonHead[MMvalue - 1];
if (MMvalue ==2 && IsPinYear(str)) n++;
writeDay(n,day)
}
function MMDD(str,year,day) //月发生变化时日期联动
{
var YYYYvalue = year.options[year.selectedIndex].value;
if (YYYYvalue == "" ){ var e = day; optionsClear(e); return;}
var n = MonHead[str - 1];
if (str ==2 && IsPinYear(YYYYvalue)) n++;
writeDay(n,day)
}
function writeDay(n,day) //据条件写日期的下拉框
{
var e = day; optionsClear(e);
for (var i=1; i<(n+1); i++)
e.options.add(new Option(i,i));
}
function IsPinYear(year)//判断是否闰平年
{ return(0 == year%4 && (year%100 !=0 || year%400 == 0));}
function optionsClear(e)
{
for (var i=e.options.length; i>0; i--)
e.remove(i);
}
function compDate(SY,SM,SD,EY,EM,ED)
{
}
一下为页面代码
<body onload="YYYYMMDDstart(document.form1,document.form1.SYear,document.form1.SMonth,document.form1.SDay);">
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="SYear" runat="server" name="SYear" onchange="YYYYDD(this.value,document.form1.SMonth,document.form1.SDay)" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SMonth" runat="server" name="SMonth" onchange="MMDD(this.value,document.form1.SYear,document.form1.SDay)" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SDay" runat="server" name="SDay" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SHour" runat="server" name="SHour" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="SMinute" runat="server" name="SMinute" AutoPostBack="True">
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label></div>
</form>
</body>
...全文
相关推荐
QQ消息定时发送器
因QQ消息对话框中的控件是绘制的,所以很难找到控件句柄。刚好自己有需求,就写了一个模拟键盘的定时发送器。在QQ2012版本中测试通过。
C#实现定时发送邮件功能
c#用System.Net.Mail和System.Threading实现邮件定时发送功能的完整源码,
LabVIEW实现定时器,获取时间日期
LabVIEW实现定时器并获取时间日期。 项目可直接运行~
Python脚本定时发送微信文件
背景:朋友让我改一个文件,可我改完已经半夜了。这时候如果微信发给朋友恐会打扰他休息。于是决定用Python写一个自动发送微信信息的脚本,第二天早上自动发送。 任务简述:使用Python自动化程序,把file.txt在早上6点准时拖动到微信并发送。 0 准备 首先需要考虑的是如何通过Python模拟鼠标操作。在此我货比三家: module stars latest commit Pyuserinput 903 2016.2.26 mouse 274 2020.1.2 PyAutoGUI 3600 2020.1.14 对比后,我们选用PyAutoGUI。 Windows
python实现微信定时每天和女友发送消息
主要为大家详细介绍了python实现微信定时每天和女友发送消息,具有一定的参考价值,感兴趣的小伙伴们可以参考一下


