From 41a5f13b090badb91a2d604216f0d39689a98654 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 17 Feb 2023 15:47:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E5=BC=82=E5=8A=A8?= =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuTransferInfoController.cs | 10 + .../Views/StuTransferInfo/IndexQuery.cshtml | 54 +++ .../Views/StuTransferInfo/IndexQuery.js | 323 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../StuTransferInfo/StuTransferInfoService.cs | 6 +- 5 files changed, 392 insertions(+), 3 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuTransferInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuTransferInfoController.cs index 02dc205d3..a0baff54b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuTransferInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuTransferInfoController.cs @@ -103,6 +103,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 综合查询 + /// + /// + [HttpGet] + public ActionResult IndexQuery() + { + return View(); + } + #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.cshtml new file mode 100644 index 000000000..76125b66e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.cshtml @@ -0,0 +1,54 @@ +@{ + ViewBag.Title = "学籍异动列表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
异动类型
+
+
+
+
姓名
+ +
+
+
班级
+
+
+
+
申请人
+
+
+
+
审核人
+
+
+
+
保留学籍
+
+
+
+
+
+
+
+
+ +
+
+  查看 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.js new file mode 100644 index 000000000..1a55138bd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuTransferInfo/IndexQuery.js @@ -0,0 +1,323 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-01-04 15:03 + * 描 述:学籍异动列表 + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 查询 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 290, 400); + $('#AnomalousType').lrDataItemSelect({ code: 'StuChangeType' }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }, + value: "classno", + text: "classname" + }); + $('#CheckUserId').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' }); + $('#CreateUserId').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' }); + $('#StuStatus').lrDataItemSelect({ code: 'YesOrNoInt' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 查看 + $('#lr_views').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行查看!"); + return; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/StuTransferInfo/GetPageList', + headData: [ + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { label: '学号', name: 'StuNo', width: 160, align: "left" }, + { + label: "性别", name: "GenderNo", width: 80, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { label: '身份证号', name: 'IdentityCardNo', width: 200, align: "left" }, + { + label: '原班级', name: 'ClassNo', width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: '原专业', name: 'MajorNo', width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + //{ + // label: '原系部', name: 'DeptNo', width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, + { label: '年级', name: 'Grade', width: 100, align: "left" }, + { + label: '学制', name: 'EduSystem', width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'EduSystem', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + //{ + // label: '入班日期', name: 'LeaveDate', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ + // label: '离班日期', name: 'EnteDate', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ + // label: '现班级', name: 'NewClassNo', width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + // key: value, + // keyId: 'classno', + // callback: function (_data) { + // callback(_data['classname']); + // } + // }); + // } + //}, + //{ + // label: '现专业', name: 'NewMajorNo', width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + // key: value, + // keyId: 'majorno', + // callback: function (_data) { + // callback(_data['majorname']); + // } + // }); + // } + //}, + //{ + // label: '现系部', name: 'NewDeptNo', width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, + //{ label: '现年级', name: 'NewGrade', width: 60, align: "left" }, + //{ + // label: '创建时间', name: 'CreateTime', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ + // label: '创建用户', name: 'CreateUserId', width: 200, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + // key: value, + // keyId: 'f_userid', + // callback: function (_data) { + // callback(_data['f_realname']); + // } + // }); + // } + //}, + //{ + // label: '审核时间', name: 'CheckTime', width: 200, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ + // label: '审核用户', name: 'CheckUserId', width: 200, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', + // key: value, + // keyId: 'f_userid', + // callback: function (_data) { + // callback(_data['f_realname']); + // } + // }); + // } + //}, + { + label: '审核状态', name: 'F_EnabledMark', width: 200, align: "left", + formatter: function (cellvalue) { + return cellvalue == "1" ? "已生效" : "未生效"; + } + }, + { + label: '异动类型', name: 'AnomalousType', width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StuChangeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + //{ label: '异动原因', name: 'ChangeReason', width: 300, align: "left" }, + //{ + // label: '是否保留学籍', name: 'StuStatus', width: 80, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'YesOrNoInt', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + //}, + //{ + // label: '是否注销账号', name: 'F_WriteMark', width: 80, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'YesOrNoInt', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + //}, + //{ + // label: '是否恢复学籍', name: 'RecoverStuStatus', width: 80, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'YesOrNoInt', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + //}, + //{ + // label: '是否恢复账号', name: 'RecoverWriteMark', width: 80, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('dataItem', { + // key: value, + // code: 'YesOrNoInt', + // callback: function (_data) { + // callback(_data.text); + // } + // }); + // } + //}, + //{ label: '修学年限', name: 'SuspensionPeriod', width: 200, align: "left" }, + //{ + // label: '休学开始时间', name: 'SuspensionBeginTime', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ + // label: '休学结束时间', name: 'SuspensionEndTime', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ label: '转学前学校', name: 'TransferSchool', width: 150, align: "left" }, + //{ label: '转学前学号', name: 'TransferStuNo', width: 100, align: "left" }, + //{ + // label: '出身日期', name: 'Birthday', width: 100, align: "left", + // formatter: function (cellvalue) { + // return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + // } + //}, + //{ label: '民族', name: 'NationalityNo', width: 80, align: "left" }, + //{ label: '省', name: 'Province', width: 100, align: "left" }, + //{ label: '市', name: 'City', width: 100, align: "left" }, + //{ label: '县/区', name: 'County', width: 100, align: "left" }, + //{ label: '联系电话', name: 'Mobile', width: 100, align: "left" }, + //{ label: '家庭地址', name: 'MailAddress', width: 200, align: "left" }, + //{ label: '转出学校', name: 'OutSchool', width: 100, align: "left" }, + //{ label: '备注', name: 'Remark', width: 500, align: "left" }, + ], + mainId: 'ID', + isPage: true, + rows: 100, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = ' and F_EnabledMark = 1 '; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index de761e40d..2f8b8552b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1366,6 +1366,7 @@ + @@ -8074,6 +8075,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs index 27ba326bc..b53ab5b50 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs @@ -90,10 +90,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); strSql.Append(" AND t.ClassNo = @ClassNo "); } - if (!queryParam["ClassNo"].IsEmpty()) + if (!queryParam["CreateUserId"].IsEmpty()) { - dp.Add("CheckUserId", queryParam["CheckUserId"].ToString(), DbType.String); - strSql.Append(" AND t.CheckUserId = @CheckUserId "); + dp.Add("CreateUserId", queryParam["CreateUserId"].ToString(), DbType.String); + strSql.Append(" AND t.CreateUserId = @CreateUserId "); } if (!queryParam["CheckUserId"].IsEmpty()) { From bfe3a9155b53d3696ed94a7ff8d526eb2a20443f Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 17 Feb 2023 17:06:42 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=88=90=E7=BB=A9,=E8=A1=A5=E8=80=83,?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E8=A1=A5=E8=80=83=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScoreNotPassTran/StuScoreNotPassTranService.cs | 6 ++++++ .../StuScoreNotPassTwoTran/StuScoreNotPassTwoTranService.cs | 5 +++++ .../StuScoreTran/StuScoreTranService.cs | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTran/StuScoreNotPassTranService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTran/StuScoreNotPassTranService.cs index 1c69e289f..75ffc4d18 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTran/StuScoreNotPassTranService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTran/StuScoreNotPassTranService.cs @@ -128,6 +128,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append("SELECT "); strSql.Append(fieldSql); strSql.Append(" FROM StuScoreNotPassTran t "); + var userlogin = LoginUserInfo.Get(); + if (userlogin.Description == "学生") + { + strSql.Append(" where 1= 1 and Stuno = '" + userlogin.account + "'"); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwoTran/StuScoreNotPassTwoTranService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwoTran/StuScoreNotPassTwoTranService.cs index 49bb84b9d..3ac5f59a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwoTran/StuScoreNotPassTwoTranService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwoTran/StuScoreNotPassTwoTranService.cs @@ -128,6 +128,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append("SELECT "); strSql.Append(fieldSql); strSql.Append(" FROM StuScoreNotPassTwoTran t "); + var userlogin = LoginUserInfo.Get(); + if (userlogin.Description == "学生") + { + strSql.Append(" where 1= 1 and Stuno = '" + userlogin.account + "'"); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreTran/StuScoreTranService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreTran/StuScoreTranService.cs index 32d9d089d..979e92b08 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreTran/StuScoreTranService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreTran/StuScoreTranService.cs @@ -130,6 +130,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append("SELECT "); strSql.Append(fieldSql); strSql.Append(" FROM StuScoreTran t "); + var userlogin = LoginUserInfo.Get(); + if (userlogin.Description == "学生") + { + strSql.Append(" where 1= 1 and Stuno = '" + userlogin.account + "'"); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); } catch (Exception ex) From be1ea41e79216a26f9fe37a6d34ea7fad2699b7e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Feb 2023 10:41:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E8=AE=BF=E9=97=AEapi=E7=9A=84=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VisitService/App.config | 10 ++ .../VisitService/Program.cs | 27 ++++ .../VisitService/ProjectInstaller.Designer.cs | 60 ++++++++ .../VisitService/ProjectInstaller.cs | 19 +++ .../VisitService/ProjectInstaller.resx | 129 ++++++++++++++++++ .../VisitService/Properties/AssemblyInfo.cs | 36 +++++ ...uanjiang.DigitalScholl.VisitService.csproj | 74 ++++++++++ .../VisitService/Service1.Designer.cs | 37 +++++ .../VisitService/Service1.cs | 76 +++++++++++ .../西昌单校区版V3.0.sln | 40 +++++- 10 files changed, 507 insertions(+), 1 deletion(-) create mode 100644 Learun.Framework.Ultimate V7/VisitService/App.config create mode 100644 Learun.Framework.Ultimate V7/VisitService/Program.cs create mode 100644 Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.Designer.cs create mode 100644 Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.cs create mode 100644 Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.resx create mode 100644 Learun.Framework.Ultimate V7/VisitService/Properties/AssemblyInfo.cs create mode 100644 Learun.Framework.Ultimate V7/VisitService/Quanjiang.DigitalScholl.VisitService.csproj create mode 100644 Learun.Framework.Ultimate V7/VisitService/Service1.Designer.cs create mode 100644 Learun.Framework.Ultimate V7/VisitService/Service1.cs diff --git a/Learun.Framework.Ultimate V7/VisitService/App.config b/Learun.Framework.Ultimate V7/VisitService/App.config new file mode 100644 index 000000000..54ca83f10 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/App.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/VisitService/Program.cs b/Learun.Framework.Ultimate V7/VisitService/Program.cs new file mode 100644 index 000000000..602b5cf38 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/Program.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace VisitService +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + static void Main() + { + ServiceBase[] ServicesToRun; + ServicesToRun = new ServiceBase[] + { + new QuanjiangDigitalSchollVisitService() + }; + ServiceBase.Run(ServicesToRun); + } + + } +} diff --git a/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.Designer.cs b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.Designer.cs new file mode 100644 index 000000000..25508f290 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.Designer.cs @@ -0,0 +1,60 @@ +namespace VisitService +{ + partial class ProjectInstaller + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); + this.QuanjiangDigitalSchollVisitService = new System.ServiceProcess.ServiceInstaller(); + // + // serviceProcessInstaller1 + // + this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem; + this.serviceProcessInstaller1.Password = null; + this.serviceProcessInstaller1.Username = null; + // + // QuanjiangDigitalSchollVisitService + // + this.QuanjiangDigitalSchollVisitService.Description = "定时访问api"; + this.QuanjiangDigitalSchollVisitService.DisplayName = "QuanjiangDigitalSchollVisitService"; + this.QuanjiangDigitalSchollVisitService.ServiceName = "QuanjiangDigitalSchollVisitService"; + this.QuanjiangDigitalSchollVisitService.StartType = System.ServiceProcess.ServiceStartMode.Automatic; + // + // ProjectInstaller + // + this.Installers.AddRange(new System.Configuration.Install.Installer[] { + this.serviceProcessInstaller1, + this.QuanjiangDigitalSchollVisitService}); + + } + + #endregion + + private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; + private System.ServiceProcess.ServiceInstaller QuanjiangDigitalSchollVisitService; + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.cs b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.cs new file mode 100644 index 000000000..5646f79a4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration.Install; +using System.Linq; +using System.Threading.Tasks; + +namespace VisitService +{ + [RunInstaller(true)] + public partial class ProjectInstaller : System.Configuration.Install.Installer + { + public ProjectInstaller() + { + InitializeComponent(); + } + } +} diff --git a/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.resx b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.resx new file mode 100644 index 000000000..0ca207778 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/ProjectInstaller.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 55 + + + 208, 17 + + + False + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/VisitService/Properties/AssemblyInfo.cs b/Learun.Framework.Ultimate V7/VisitService/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..1f9b4efc5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("VisitService")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HP Inc.")] +[assembly: AssemblyProduct("VisitService")] +[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("1d482884-8749-41e7-b1e3-362612799615")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Learun.Framework.Ultimate V7/VisitService/Quanjiang.DigitalScholl.VisitService.csproj b/Learun.Framework.Ultimate V7/VisitService/Quanjiang.DigitalScholl.VisitService.csproj new file mode 100644 index 000000000..0de2af6e7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/Quanjiang.DigitalScholl.VisitService.csproj @@ -0,0 +1,74 @@ + + + + + Debug + AnyCPU + {1D482884-8749-41E7-B1E3-362612799615} + WinExe + Quanjiang.DigitalScholl.VisitService + Quanjiang.DigitalScholl.VisitService + v4.5.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Component + + + ProjectInstaller.cs + + + Component + + + Service1.cs + + + + + + + + + + ProjectInstaller.cs + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/VisitService/Service1.Designer.cs b/Learun.Framework.Ultimate V7/VisitService/Service1.Designer.cs new file mode 100644 index 000000000..31f81b5a1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/Service1.Designer.cs @@ -0,0 +1,37 @@ +namespace VisitService +{ + partial class QuanjiangDigitalSchollVisitService + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.ServiceName = "QuanjiangDigitalSchollVisitService"; + } + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/VisitService/Service1.cs b/Learun.Framework.Ultimate V7/VisitService/Service1.cs new file mode 100644 index 000000000..6e2dd3ce2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/VisitService/Service1.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace VisitService +{ + public partial class QuanjiangDigitalSchollVisitService : ServiceBase + { + public QuanjiangDigitalSchollVisitService() + { + InitializeComponent(); + } + + private System.Timers.Timer timer1 = new System.Timers.Timer(60000); + private static string pathbase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; + //private static string logPath = pathbase + @"\" + DateTime.Now.ToString("yyyyMMdd") + @"\log_start.txt"; + protected override void OnStart(string[] args) + { + timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed); + timer1.AutoReset = true; + timer1.Enabled = true; + timer1.Start(); + } + + protected override void OnStop() + { + this.timer1.Enabled = false; + } + + private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) + { + var logPath_timer = pathbase + @"\" + DateTime.Now.ToString("yyyyMMdd") + @"\log.txt"; + try + { + //记录日志 + if (!Directory.Exists(pathbase + @"\" + DateTime.Now.ToString("yyyyMMdd"))) + { + //不存在文件夹则创建 + DirectoryInfo directoryInfo = new DirectoryInfo(pathbase + @"\" + DateTime.Now.ToString("yyyyMMdd")); + directoryInfo.Create(); + } + if (!File.Exists(logPath_timer)) + { + FileStream fs = File.Create(logPath_timer);//创建文件 + fs.Close(); + } + + System.GC.Collect(); + var url = System.Configuration.ConfigurationManager.AppSettings["cyapi"].ToString(); + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); + myRequest.KeepAlive = false; + myRequest.Method = "HEAD"; //设置提交方式可以为"get","head"等 + myRequest.Timeout = 30000; //设置网页响应时间长度 + myRequest.AllowAutoRedirect = false; //是否允许自动重定向 + HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); + // return (myResponse.StatusCode == HttpStatusCode.OK);//返回响应的状态 + + System.IO.File.AppendAllText(logPath_timer, + "\r\n" + DateTime.Now + "\r\n访问结果:" + myResponse.StatusCode); + } + catch (Exception ex) + { + System.IO.File.AppendAllText(logPath_timer, + "\r\n" + DateTime.Now + "\r\n访问结果异常,异常信息:" + ex.Message); + } + } + } +} diff --git a/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln b/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln index 926013aee..7d51a2054 100644 --- a/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln +++ b/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln @@ -128,6 +128,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quanjiang.DigitalSchool.Asp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quanjiang.DigitalScholl.SendSms", "Quanjiang.DigitalScholl.SendSms\Quanjiang.DigitalScholl.SendSms.csproj", "{65CC5CDC-9638-4DD0-B2D6-3182CC16D2DA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quanjiang.DigitalScholl.VisitService", "VisitService\Quanjiang.DigitalScholl.VisitService.csproj", "{1D482884-8749-41E7-B1E3-362612799615}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Android = Debug|Android @@ -1662,6 +1664,42 @@ Global {65CC5CDC-9638-4DD0-B2D6-3182CC16D2DA}.Release|Windows-x64.Build.0 = Release|Any CPU {65CC5CDC-9638-4DD0-B2D6-3182CC16D2DA}.Release|Windows-x86.ActiveCfg = Release|Any CPU {65CC5CDC-9638-4DD0-B2D6-3182CC16D2DA}.Release|Windows-x86.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Android.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Android.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|iOS.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|iOS.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-ARM.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-ARM.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-x64.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-x64.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-x86.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Debug|Windows-x86.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Android.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Android.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Any CPU.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Any CPU.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|iOS.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|iOS.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-ARM.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-ARM.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-x64.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-x64.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-x86.ActiveCfg = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Development|Windows-x86.Build.0 = Debug|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Android.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Android.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Any CPU.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|iOS.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|iOS.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-ARM.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-ARM.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-x64.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-x64.Build.0 = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-x86.ActiveCfg = Release|Any CPU + {1D482884-8749-41E7-B1E3-362612799615}.Release|Windows-x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1713,7 +1751,7 @@ Global {E05A2B9A-A939-450F-9A44-A8B3201D055A} = {ED258CD0-0A0C-490B-9D8F-B4CEC4467251} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 SolutionGuid = {968C278F-4142-4DFF-96B0-B3D70A649451} + EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 EndGlobalSection EndGlobal From 4bd4d7eae55acd7c55f7694cb13c06669abba977 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Feb 2023 10:55:24 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E5=A4=9A=E4=B8=AA=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VisitService/App.config | 2 +- .../VisitService/Service1.cs | 31 +++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Learun.Framework.Ultimate V7/VisitService/App.config b/Learun.Framework.Ultimate V7/VisitService/App.config index 54ca83f10..139ba7c57 100644 --- a/Learun.Framework.Ultimate V7/VisitService/App.config +++ b/Learun.Framework.Ultimate V7/VisitService/App.config @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/VisitService/Service1.cs b/Learun.Framework.Ultimate V7/VisitService/Service1.cs index 6e2dd3ce2..2d1b01d03 100644 --- a/Learun.Framework.Ultimate V7/VisitService/Service1.cs +++ b/Learun.Framework.Ultimate V7/VisitService/Service1.cs @@ -55,16 +55,29 @@ namespace VisitService System.GC.Collect(); var url = System.Configuration.ConfigurationManager.AppSettings["cyapi"].ToString(); - HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); - myRequest.KeepAlive = false; - myRequest.Method = "HEAD"; //设置提交方式可以为"get","head"等 - myRequest.Timeout = 30000; //设置网页响应时间长度 - myRequest.AllowAutoRedirect = false; //是否允许自动重定向 - HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); - // return (myResponse.StatusCode == HttpStatusCode.OK);//返回响应的状态 + var arr = url.Split(';'); + foreach (var item in arr) + { + try + { + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); + myRequest.KeepAlive = false; + myRequest.Method = "HEAD"; //设置提交方式可以为"get","head"等 + myRequest.Timeout = 30000; //设置网页响应时间长度 + myRequest.AllowAutoRedirect = false; //是否允许自动重定向 + HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); + // return (myResponse.StatusCode == HttpStatusCode.OK);//返回响应的状态 + + System.IO.File.AppendAllText(logPath_timer, + "\r\n" + DateTime.Now + "\r\n访问结果:" + myResponse.StatusCode); + } + catch (Exception ex) + { + System.IO.File.AppendAllText(logPath_timer, + "\r\n" + DateTime.Now + "\r\n访问结果异常,异常信息:" + ex.Message + ",访问地址:" + item); + } + } - System.IO.File.AppendAllText(logPath_timer, - "\r\n" + DateTime.Now + "\r\n访问结果:" + myResponse.StatusCode); } catch (Exception ex) { From 297e1fd6254b9fa3ae9cc20b956d5f3d762bfe46 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Feb 2023 10:56:03 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learun.Framework.Ultimate V7/VisitService/App.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/VisitService/App.config b/Learun.Framework.Ultimate V7/VisitService/App.config index 139ba7c57..b56e2c4f5 100644 --- a/Learun.Framework.Ultimate V7/VisitService/App.config +++ b/Learun.Framework.Ultimate V7/VisitService/App.config @@ -4,7 +4,7 @@ - + \ No newline at end of file From 9e3507be7652e1b009598e2bf3c9bfa238bd8fbe Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Feb 2023 11:21:48 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learun.Framework.Ultimate V7/VisitService/Service1.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Learun.Framework.Ultimate V7/VisitService/Service1.cs b/Learun.Framework.Ultimate V7/VisitService/Service1.cs index 2d1b01d03..57d59a2d3 100644 --- a/Learun.Framework.Ultimate V7/VisitService/Service1.cs +++ b/Learun.Framework.Ultimate V7/VisitService/Service1.cs @@ -60,6 +60,8 @@ namespace VisitService { try { + System.IO.File.AppendAllText(logPath_timer, + "\r\n" + DateTime.Now + "\r\n开始访问:" + item); HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); myRequest.KeepAlive = false; myRequest.Method = "HEAD"; //设置提交方式可以为"get","head"等 From b887b6d41a04f4a2d0ca89891f19d8baa2b9c91e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sat, 18 Feb 2023 11:35:36 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AE=BF=E9=97=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learun.Framework.Ultimate V7/VisitService/Service1.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Learun.Framework.Ultimate V7/VisitService/Service1.cs b/Learun.Framework.Ultimate V7/VisitService/Service1.cs index 57d59a2d3..3998ec890 100644 --- a/Learun.Framework.Ultimate V7/VisitService/Service1.cs +++ b/Learun.Framework.Ultimate V7/VisitService/Service1.cs @@ -53,7 +53,6 @@ namespace VisitService fs.Close(); } - System.GC.Collect(); var url = System.Configuration.ConfigurationManager.AppSettings["cyapi"].ToString(); var arr = url.Split(';'); foreach (var item in arr) @@ -62,16 +61,17 @@ namespace VisitService { System.IO.File.AppendAllText(logPath_timer, "\r\n" + DateTime.Now + "\r\n开始访问:" + item); + HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); myRequest.KeepAlive = false; myRequest.Method = "HEAD"; //设置提交方式可以为"get","head"等 - myRequest.Timeout = 30000; //设置网页响应时间长度 + //myRequest.Timeout = 60000; //设置网页响应时间长度 myRequest.AllowAutoRedirect = false; //是否允许自动重定向 HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); // return (myResponse.StatusCode == HttpStatusCode.OK);//返回响应的状态 - System.IO.File.AppendAllText(logPath_timer, "\r\n" + DateTime.Now + "\r\n访问结果:" + myResponse.StatusCode); + myResponse.Dispose(); } catch (Exception ex) {