随笔分类 - C#.NET
摘要:进入vs可执行文件的目录,如:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE 运行命令: cd C:\Program Files (x86)\Microsoft Visual Studio\2019
阅读全文
摘要:public static string ToHexString(byte[] bytes) // 0xae00cf => "AE00CF " { string hexString = string.Empty; if (bytes != null) { StringBuild...
阅读全文
摘要:前端代码 protected void Page_Load(object sender, EventArgs e) { Base64StringToImage(Request.Form["img"]); } private void Base64StringToImag...
阅读全文
摘要:(此博客文章纯属个人记录,转载请注明出处!)官方地址:NHtmlUnit编译获取dll方法:1.下载nuget.exe(nuget所在网站:http://www.nuget.org/)2.打开DOS命令对话框,进入nuget.exe文件所在目录(我的exe文件放在桌面)3.运行命令安装NHtmlUn...
阅读全文
摘要:官网地址:htmlagilitypack百度网盘下载地址:点击使用方法: 1.引用HtmlAgilityPack.dll文件 2.引用命名空间:using HtmlAgilityPack; 3.调用(元素查找方式为xpath,用法参见w3school): static void Main(string[] args) { string html = GetHtml("http://www.w3school.com.cn/xpath/xpath_syntax.asp"); HtmlDocument doc = new...
阅读全文
摘要:在Windows服务的安装类ProjectInstaller中加入以下方法:protected override void OnCommitted(System.Collections.IDictionary savedState) { base.OnCommitted(savedState); //将服务更改为允许桌面交互模式 ConnectionOptions coOptions = new ConnectionOptions(); coOptions.Impersonation = Im...
阅读全文
摘要:做此程序的原因是将软件部署简化,省去IIS的麻烦部署,减少项目实施人员的工作量和工作复杂度Server sv = new Server(8000, "/", @"D:\web", IPAddress.Any, null, "Login.aspx");// **********************************************************************************// CassiniDev - http://cassinidev.codeplex.com// // Copyrigh
阅读全文