随笔分类 - C# WinService
服务
摘要:1、首先在线安装SQLite 主要的引用 2.App.config配置文件 <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Fram
阅读全文
摘要:定义一个销售接口 ICarSalsecs public interface ICarSalsecs { /// <summary> /// 优惠折扣方案接口 /// </summary> /// <param name="policType">打折类型</param> /// <param name
阅读全文
摘要:strDate="2019-03" DateTime Date = DateTime.Parse(strDate); //要取得月份的某一天第一天 string FirstDay= Date.AddMonths(-1).Date.AddDays(1 - Date.Day)...
阅读全文
摘要:识别车牌的误差低于2位显示入场记录信息 高于2位不显示识别规则 根据省份误差为1位+后面数字字母误差为1位只要两者结合误差率为 <= 2 即可显示匹配的车牌入场记录也就是说省份错误为1位 + 后面任何1位错误 就显示 匹配相似信息 例如:豫A BCDE9 豫A BCDE8 粤A BCDE9 粤B B
阅读全文
摘要:C#调用利用C++写的dll 常遇到的情况是无法加载DLL"***.dll":找不到指定的模块(异常来自HRESULT:0x8007007E)终极解决方法如下: 1、产生原因 可能存在 老版本程序正常,在新的版本中调用异常问题,可能本地电脑系统缺乏相关的支持DLL 2、要解决此方法 就是用工具软件终
阅读全文
摘要:string plate="粤BN1223"; if (plate.Contains("粤BN")) { //除掉前三个字符,剩下的4个字符全为数字方为特殊车辆 bool BNum = true; char[] strSubCCode = new char[...
阅读全文
摘要:首先上界面:再看拆分功能演示:上代码:using DevComponents.DotNetBar;using NPOI.HSSF.UserModel;using NPOI.SS.UserModel;using System;using System.Collections;using System....
阅读全文
摘要:根据节假日表分析当前日期是否属于节假日配置表的时间以及判定当前日期是否属于双休日 首先建一张节假日表PricingHoliday ID 节假日时间 HDate 是否工作日 HType 2表示不上班 非工作日, 1表示正常上班 工作日 判定代码: 使用类:
阅读全文
摘要:安装服务:@echo off@echo offset filename=LXServer.exeset servicename=Service1set Frameworkdc=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319if exist "%Fram...
阅读全文
摘要:在窗体属性中有个EnableGlass属性,设置为False即可。
阅读全文
摘要:若对窗体控件label进行赋值 delegate void SetLabelText(int str);//定义委托,用来完成线程的赋值 /// /// 为label赋值 /// /// private void ...
阅读全文
摘要:创建类WebServiceHelper:public class WebServiceHelper { #region 动态调用WebService动态调用地址 /// /// 动态调用web服务 ...
阅读全文
摘要://Application.Exit()是退出整个应用程序 Application.ExitThread();//强制中止调用线程上的所有消息,同样面临其它线程无法正确退出的问题 System.Diagnostics.Process...
阅读全文
摘要:通过webservices接口获取手机号码归属地:引用webservices地址:http://api.showji.com/locating/Mobile.asmx主要代码:using System;using System.Collections.Generic;using System.Com...
阅读全文
摘要:/// /// 读取xml中的指定节点的值 /// private string ReadXmlNode(string filename) { string result = "-1"; ...
阅读全文
摘要:#region 字符转码 /// /// 对指定字符串进行URL标准化转码 中文字符串转换成UTF-8 /// /// /// /// public static string UrlEncode(strin...
阅读全文
摘要:/// /// 使用TimeSpan计算两个时间差 /// /// /// /// Subtract:从中减去另一个TimeSpan值 private string DateDiff(Dat...
阅读全文