Skip to content

Commit

Permalink
2017-9-11
Browse files Browse the repository at this point in the history
  • Loading branch information
South-Walker committed Sep 11, 2017
1 parent 3808ff9 commit a0107ef
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.config
Binary file modified .vs/WeChatMVC/v14/.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions WeChatMVC/Controllers/APIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public static string CrawlerFromJwc(string studentnum, string pwd, JWCHttpHelper
{
string answer = (string)detail();
JWCHttpHelper.ClearCookies();
//这里重载
JWCHttpHelper.IsLogin = false;
return answer;
}
else
Expand Down
4 changes: 2 additions & 2 deletions WeChatMVC/Controllers/WeChatController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public string Index() //回复全都是xml格式的string
{
//测试语句
//return APIController.CrawlerFromJwc("10150111", "***ak96101", JWCHttpHelper.jwc_largetable);
// return DBManual.SelectFromJwc("oRunv0fTKxpbL0e8hYUEplWFYx64", JWCHttpHelper.classtable);
// return DBManual.SelectFromJwc("oRunv0fTKxpbL0e8hYUEplWFYx64", JWCHttpHelper.classtable);
if (IsFromTencent("961016") && Request.HttpMethod == "GET")
{
return Request["echostr"];
Expand Down Expand Up @@ -83,7 +83,7 @@ public string Index() //回复全都是xml格式的string
else if (message.Length > DBManual.xhmes.Length && message.Substring(0, DBManual.xhmes.Length) == DBManual.xhmes)
{
DBManual.AddIntoView_Wechatpwds(message.Substring(DBManual.xhmes.Length), userrequest.FromUserName, DBManual.xhmes);
return userrequest.Get_Reply("学号已修改,现在您绑定的学号为:" + message.Substring(DBManual.xhmes.Length));
return userrequest.Get_Reply("学号已修改,现在您绑定的学号为:" + message.Substring(DBManual.xhmes.Length) + "请输入jwc + 您的教务处密码来绑定,如jwc123456");
}
else if (message.Length > DBManual.jwcmes.Length && message.Substring(0, DBManual.jwcmes.Length) == DBManual.jwcmes)
{
Expand Down
26 changes: 16 additions & 10 deletions WeChatMVC/Models/JWCHttpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System;
using WeChatMVC.Models;
using System.Web.Mvc;
using System.Web;

namespace WeChatMVC.Models
{
Expand Down Expand Up @@ -123,7 +124,6 @@ public static object jwc_gradepoint(bool isjson = false)
}
public static object jwc_classtable(bool isjson = false)
{
// 功能待启用
JWCHttpHelper d = new JWCHttpHelper("http://inquiry.ecust.edu.cn/ecustedu/E_SelectCourse/ScInFormation/syllabus.aspx");
d.HttpPost("__VIEWSTATE=%2FwEPDwUKLTg3NzgzODIwNw9kFgICAQ9kFgICAw8QDxYGHg1EYXRhVGV4dEZpZWxkBQhZZWFyVGVybR4ORGF0YVZhbHVlRmllbGQFAnNtHgtfIURhdGFCb3VuZGdkEBUCBTIwMTcxBTIwMTYyFQIJ5LiL5a2m5pyfCeacrOWtpuacnxQrAwJnZ2RkZNO%2Fri3X13dLfsVR9NFAAfI1ATzP&selyeartermflag=%E4%B8%8B%E5%AD%A6%E6%9C%9F&bttn_search=%E6%9F%A5%E8%AF%A2&__EVENTVALIDATION=%2FwEWBAKX%2B67KDQKukO%2FqDwLJpuDqDwK1man8CYWGxTfqcteijecSaCWqU1U3a0ll");
string html = d.ToString();
Expand All @@ -132,10 +132,9 @@ public static object jwc_classtable(bool isjson = false)
Regex zhiti = new Regex("</font>");
html = zhiti.Replace(html, "");
ClassTableob classtable = new ClassTableob(html, new DateTime(2017, 9, 11));
//启用时日期改为当前时间
if (!isjson)
{
return classtable.GetStringToday(new DateTime(2017, 9, 11));
return classtable.GetStringToday(DateTime.Now) + "\r\n" + classtable.GetStringToday(DateTime.Now.AddDays(1), true) + "记得带上课本哦";
}
else
{
Expand Down Expand Up @@ -184,7 +183,7 @@ public static void Login(string studentnum, string pwd)
}
else if (JWCHttpHelper.regexpwdfail.IsMatch(html))
{
ErrorMsg = "您现在设置的教务处密码:" + pwd + ",不正确。请重新输入jwc+您的教务处密码来解锁此功能,如jwc123456";
ErrorMsg = "您现在设置的教务处密码:" + HttpUtility.UrlDecode(pwd) + ",不正确。请重新输入jwc+您的教务处密码来解锁此功能,如jwc123456";
return;
}
else if (JWCHttpHelper.regexstudentnumfail.IsMatch(html))
Expand All @@ -196,7 +195,7 @@ public static void Login(string studentnum, string pwd)
{
Login(studentnum, pwd);
}
ErrorMsg = "unknownfail";
ErrorMsg = "学号或密码错误";
return;
}
}
Expand Down Expand Up @@ -740,19 +739,26 @@ public List<Classob> GetClassToday(DateTime today)
}
return result;
}
public string GetStringToday(DateTime today)
public string GetStringToday(DateTime today,bool istomorrow = false)
{
string result = "";
if (istomorrow)
{
result += today.Year + "年" + today.Month + "月" + today.Day + "日(明天)\r\n";
}
else
{
result += today.Year + "年" + today.Month + "月" + today.Day + "日(今天)\r\n";
}
List<Classob> todayclasses = GetClassToday(today);
for (int i = 0; i < todayclasses.Count; i++)
{
result += todayclasses[i].classname + "\r\n";
result += todayclasses[i].room + "\r\n";
result += todayclasses[i].timebegin + "-" + todayclasses[i].timeend + "节\r\n\r\n";
result += todayclasses[i].timebegin + "-" + todayclasses[i].timeend + "节\r\n";
}
if (result == "")
return "今天并没有安排课程!";
result += today.Year + "年" + today.Month + "月" + today.Day + "日";
if (todayclasses.Count == 0)
result += "今天并没有安排课程!\r\n";
return result;
}
}
Expand Down
Binary file modified WeChatMVC/bin/WeChatMVC.dll
Binary file not shown.
Binary file modified WeChatMVC/bin/WeChatMVC.pdb
Binary file not shown.
Binary file modified WeChatMVC/obj/Release/Package/PackageTmp/bin/WeChatMVC.dll
Binary file not shown.
Binary file modified WeChatMVC/obj/Release/WeChatMVC.dll
Binary file not shown.
Binary file modified WeChatMVC/obj/Release/WeChatMVC.pdb
Binary file not shown.
Binary file modified wechatpost/.vs/wechatpost/v14/.suo
Binary file not shown.
5 changes: 2 additions & 3 deletions wechatpost/wechatpost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ static void Main(string[] args)
//wx9e64b20cf4937a98
//7d7d04064acdf0e0f5e51c7a3e0240ea
//https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx9e64b20cf4937a98&secret=7d7d04064acdf0e0f5e51c7a3e0240ea
//https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx02d0aa4845c8f9ae&secret=77c0f9d24fd9c63c28aadf6f05d04311
string post = "{\"button\":[{ \"name\":\"拾光TEN\", \"sub_button\":[{\"type\":\"click\",\"name\":\"卿卿如唔\",\"key\":\"hualitong_love\"},{\"type\":\"view\",\"name\":\"我要卖室友\",\"url\":\"http://koudaigou.net/f/58e25d0abb7c7c57ac3b76e1/\"},{\"type\":\"view\",\"name\":\"双创协会\",\"url\":\"http://m.ecustcxcy.icoc.me\"}]},{ \"name\":\"四维口袋\", \"sub_button\":[{\"type\":\"click\",\"name\":\"更改绑定\",\"key\":\"hualitong_changestudentnum\"},{\"type\":\"click\",\"name\":\"今日课表\",\"key\":\"hualitong_classtable\"},{\"type\":\"click\",\"name\":\"一键成绩\",\"key\":\"hualitong_grade\"},{\"type\":\"click\",\"name\":\"一键评教\",\"key\":\"hualitong_pj\"},{\"type\":\"click\",\"name\":\"更多功能\",\"key\":\"hualitong_more\"}]},{ \"name\":\"关于我们\", \"sub_button\":[{\"type\":\"view\",\"name\":\"四六级管家\",\"url\":\"http://msg.weixiao.qq.com/t/d03a96c84480a4cf1e33d4ec385d47fb\"},{\"type\":\"view\",\"name\":\"华理夜市\",\"url\":\"http://wx.quanzijishi.com/circle/o0es947g45u\"},{\"type\":\"click\",\"name\":\"实用工具\",\"key\":\"hualitong_helper\"},{\"type\":\"view\",\"name\":\"APP下载\",\"url\":\"http://dvomg.xiuzan001.cn/marketing/9e3x7o0z37nr.html\"},{\"type\":\"view\",\"name\":\"加入我们\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7605be91175e1d69&redirect_uri=http%3A%2F%2Fh5.ixiuzan.cn%2Fbridge%2Findex.html%3FbackUrl%3Dhttp%253A%252F%252Fdvomg.xiuzan001.cn%252Fbaoming%252FplGx7j3omgZQ.html&response_type=code&scope=snsapi_userinfo&state=869971&connect_redirect=1#wechat_redirect\"}]}]}";
string acc = "Osl3phGnq3-ysMA7xcMebbzuVwXcYSEZL_uqeHnOclFCxdm5WEfLNf-RzMTxRYE9H6cupHP2kJSkGUGDBhFJc2rAmdT48aGeNxEnyH8He3NktpIEM3EzXj7q-HV2jIJhRNGcAEAGCV";
string post = "{\"button\":[{ \"name\":\"拾光TEN\", \"sub_button\":[{\"type\":\"click\",\"name\":\"卿卿如唔\",\"key\":\"hualitong_love\"},{\"type\":\"view\",\"name\":\"我要卖室友\",\"url\":\"http://koudaigou.net/f/58e25d0abb7c7c57ac3b76e1/\"},{\"type\":\"view\",\"name\":\"双创协会\",\"url\":\"http://m.ecustcxcy.icoc.me\"}]},{ \"name\":\"四维口袋\", \"sub_button\":[{\"type\":\"click\",\"name\":\"更改绑定\",\"key\":\"hualitong_changestudentnum\"},{\"type\":\"click\",\"name\":\"今明课表\",\"key\":\"hualitong_classtable\"},{\"type\":\"click\",\"name\":\"一键成绩\",\"key\":\"hualitong_grade\"},{\"type\":\"click\",\"name\":\"一键评教\",\"key\":\"hualitong_pj\"},{\"type\":\"click\",\"name\":\"更多功能\",\"key\":\"hualitong_more\"}]},{ \"name\":\"关于我们\", \"sub_button\":[{\"type\":\"view\",\"name\":\"四六级管家\",\"url\":\"http://msg.weixiao.qq.com/t/d03a96c84480a4cf1e33d4ec385d47fb\"},{\"type\":\"view\",\"name\":\"华理夜市\",\"url\":\"http://wx.quanzijishi.com/circle/o0es947g45u\"},{\"type\":\"click\",\"name\":\"实用工具\",\"key\":\"hualitong_helper\"},{\"type\":\"view\",\"name\":\"APP下载\",\"url\":\"http://dvomg.xiuzan001.cn/marketing/9e3x7o0z37nr.html\"},{\"type\":\"view\",\"name\":\"加入我们\",\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7605be91175e1d69&redirect_uri=http%3A%2F%2Fh5.ixiuzan.cn%2Fbridge%2Findex.html%3FbackUrl%3Dhttp%253A%252F%252Fdvomg.xiuzan001.cn%252Fbaoming%252FplGx7j3omgZQ.html&response_type=code&scope=snsapi_userinfo&state=869971&connect_redirect=1#wechat_redirect\"}]}]}";
string acc = "SMfIpiZv9bBU4-Zl8hHqL1Wn9bvSqDjuKfNL2DbBzZ9lDnLbuOYnfoZQeJ8jzsJYjdrmIaNqa-6PKoSC1eU8uYbHA6vcpRpPBm0GNumO8cXPrUwOBNOmbBKVi8MeaRtoRFCfAEADRO";
string url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + acc;
MyHttpHelper a = new MyHttpHelper(url);
a.HttpPost(post);
Expand Down
Binary file modified wechatpost/wechatpost/bin/Debug/wechatpost.exe
Binary file not shown.
Binary file modified wechatpost/wechatpost/bin/Debug/wechatpost.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ C:\Users\Administrator\Desktop\华理通\wechatpost\wechatpost\obj\Debug\wechatp
C:\Users\Administrator\Desktop\华理通\wechatpost\wechatpost\bin\Debug\wechatpost.exe
C:\Users\Administrator\Desktop\华理通\wechatpost\wechatpost\bin\Debug\wechatpost.pdb
C:\Users\Administrator\Desktop\华理通\wechatpost\wechatpost\obj\Debug\wechatpost.csprojResolveAssemblyReference.cache
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\bin\Debug\wechatpost.exe.config
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\obj\Debug\wechatpost.exe
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\obj\Debug\wechatpost.pdb
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\bin\Debug\wechatpost.exe
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\bin\Debug\wechatpost.pdb
C:\Users\Administrator\Desktop\WeChatMVC\wechatpost\wechatpost\obj\Debug\wechatpost.csprojResolveAssemblyReference.cache
Binary file modified wechatpost/wechatpost/obj/Debug/wechatpost.exe
Binary file not shown.
Binary file modified wechatpost/wechatpost/obj/Debug/wechatpost.pdb
Binary file not shown.

0 comments on commit a0107ef

Please sign in to comment.