- 博客(91)
- 资源 (1)
- 收藏
- 关注
原创 .Net判断网站登录设备
/// <summary> /// 描述:通过UserAgent判断智能设备(Android,IOS,PC,Mac) /// </summary> /// <returns></returns> protected bool CheckAgent() { bool flag = false; string agent = Req..
2022-05-27 15:41:27 155
原创 The type ‘BM.ERP.Hrm.Rlb.BusinessType‘ and the type ‘BM.ERP.OaSFTempStatistics.Enum.BusinessType‘ bo
The type 'BM.ERP.Hrm.Rlb.BusinessType' and the type 'BM.ERP.OaSFTempStatistics.Enum.BusinessType' both have the same simple name of 'BusinessType' and so cannot be used in the same model. All types in a given model must have unique simple names. Use 'NotMa
2022-05-17 15:01:10 210
原创 消息队列(.Net)
using Abp.Notifications;using Abp.Runtime.Caching;using System;using System.Collections.Concurrent;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace BM.ERP.Notifications{ public class.
2022-05-13 16:26:23 646
原创 .Net使用依赖注入查询更新
使用依赖注释的好处在于可以直接使用Insert,Update,Delete,Get等方法操作数据库,不需要在另外调用其他方法操作using Abp.Application.Services.Dto;using Abp.Collections.Extensions;using Abp.Domain.Repositories;using Abp.Organizations;using Abp.UI;using BM.ERP.Dto;using BM.ERP.Sys.Organizationdet
2022-05-13 14:09:12 155
原创 .Net调用第三方系统接口
using Abp.Organizations;using MongoDB.Bson;using Newtonsoft.Json;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Security.Cryptography;using System.Text;using System.Threading.Tasks;.
2022-05-13 13:48:56 1839
原创 Sql获取当前数据库统计详情
use lxxTestgoselect count(*) 用户表 from sysobjects where xtype='u' select count(*) 总表数 from sysobjects where xtype in('u','s')select count(*) 总视图数 from sysobjects where xtype='v'select count(*) 总存储过程数 from sysobjects where xtype='p'select count(
2022-04-28 14:58:17 874
原创 敏感词汇过滤
[HttpPost]public ActionResult SendMsg(string content){content = SensitiveWordsHelper.SensitiveTextFilter(content,);return Json(content);}//敏感词验证类public class SensitiveWordsHelper { protected static readonly Logger _logger = LogManager.
2022-04-06 11:14:14 288
原创 .net记录单个接口的耗时输出
[HttpGet] public IActionResult Get() { // Start the watch var watch = new Stopwatch(); watch.Start(); --这里是逻辑代码块 watch.Stop(); var responseTimeForCompleteRequest = watch.ElapsedMilliseconds; }...
2022-03-19 08:59:09 294
原创 .net简单的登录认证帮助类
using CodeIo.Domain.Entity.Enum;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace Circulation.Web.Extensions{ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inher.
2022-01-20 09:03:22 199
原创 .net性能最高的EF分页写法
/// <summary> /// 获取资金流 /// </summary> /// <returns></returns> [HttpGet] public ActionResult GetUserCashFlows(int? pageIndex, int? pageSize, int month, string search) { v..
2022-01-20 08:55:32 184
原创 .net简单的退出登录方法
/// <summary> /// 退出系统 /// </summary> /// <returns></returns> public ActionResult Quit() { Session.Abandon(); //取消Session会话 Session["UserId"] = null; S...
2022-01-20 08:43:09 650
原创 .NET 64位编码转图片
/// <summary> /// .net64位编码转图片 /// </summary> /// <param name="UrlPath">64位编码</param> /// <returns></returns> [HttpPost] public string SaveImage(string UrlPath) {..
2022-01-08 09:21:15 410
原创 .net从项目根目录读取Excel工作簿内容,随机抽取
//交互接口 /// <summary> /// 选择运输方案(批量生成) /// </summary> /// <param name="caseId">案例</param> /// <returns></returns> [HttpPost] public ActionResult BatchAddCaseTransportation
2022-01-05 11:45:17 205
原创 .net下载到本地为excel格式
接口: public ActionResult DemoPostDownLoad() { var caseid = (string)Session["CaseId"]; var companyId = (string)Session["CompanyId"]; var demoPost = new List<DemoPostAndAge>(); IWorkbook workboo
2021-12-22 14:03:57 470
原创 读取Word文档内容
string floder = Server.MapPath("~/Data/Case/"); //word文档项目存放文件夹 //读取word文档 Document doc = new Document(floder + caseName); //路径+文件名 string WithinString = doc.GetText(); //读取
2021-11-05 09:01:12 436
原创 .net获取枚举类中文名称(封装方法)
public static string GetDescription(this Enum obj) { return GetDescription(obj, false); } public static string GetDescription(this Enum obj, bool isTop) { if (obj == null) return st..
2021-09-27 08:14:52 757
原创 Sql去重语句
海量数据(百万以上),其中有些全部字段都相同,有些部分字段相同,怎样高效去除重复?如果要删除手机(mobilePhone),电话(officePhone),邮件(email)同时都相同的数据,以前一直使用这条语句进行去重:delete from 表 where id not in(select max(id) from 表 group by mobilePhone,officePhone,email )ordelete from 表 where id not in(select min(id)
2021-09-06 17:24:32 2947
原创 C#备份数据库到项目中指定的文件夹
[HttpPost] public ActionResult AddBackup(string name) { var result = new ResultDto(); #region SqlServer备份 string path = Server.MapPath("~/Data/Backup/"); if (!Directory.Exists(path)) .
2021-06-26 17:16:45 339
原创 C#读取项目中文件夹下的文件
public ActionResult GetBackUpFile(int? page, int? limit) { ResultDto result = new ResultDto(); --返回状态信息 string path = Server.MapPath("~/Data/Backup/"); --获取项目中存储文件的物理路径 List<BackupDto> ..
2021-06-26 17:15:04 2049
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人