随笔分类 - c#
摘要:/// <summary> /// 获取电脑 MAC地址 /// </summary> /// <param name="separator"></param> /// <returns></returns> public static List<string> GetActiveMacAddres
阅读全文
摘要:public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFilePr
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tas
阅读全文
摘要:SplashScreen类为WPF应用程序提供启动屏幕。 方法一:设置图片属性 1. 添加启动图片到项目中 2. 设置图片属性的Build Action为SplashScreen 方法二:编写代码 1. 在App.xaml.cs中重写OnStartUp方法: using System; using
阅读全文
摘要:方法:如果是在Windows Server 2012本地控制台下,直接按Win(键盘上的微软徽标键)+R,输入:rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0回车后,勾选所需要的桌面图标的名称,确定即可。
阅读全文
摘要:--- 使用字符串拼接id,title SELECT *, before = ( SELECT TOP 1 (convert(varchar(36),ContentId)+'|'+Title) as aa FROM Cms_Content WHERE CreateDate > ( SELECT CreateDate FROM Cms_Content WHERE ContentId...
阅读全文
摘要:
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace WindowsAPI { class CSharp_Win32Api { #region Us...
阅读全文
摘要:程序在32位操作系统上运行正常,在64位操作系统上运行读卡功能提示”试图加载格式不正确“。 点击项目属性,把目标平台Any CPU 设置为X86
阅读全文
摘要:在com 引用那应该找名字叫microsoft web 浏览器,也可以按浏览选c:\winnt\system32\shdocvw.dll
阅读全文
摘要:首先下载安装版的AutoIt3,安装后有个AutoItX3.dll,复制到程序bin目录下。 然后添加类文件:
阅读全文
摘要:无论name=''或者name为null都可以查到
阅读全文
摘要:static void Main(string[] args) { var url = "http://192.168.20.58/gfwd/comments-1.html"; using (var driver = new PhantomJSDriver(@"E:\selenium\phantomjs-2.1.1-windows\...
阅读全文
摘要:Selenium中的显示等待指的是,等待某一元素出现或者等待页面加载完成后,才执行下一步。需要用到WebDriverWait类。 例如: 但是在.net core最新版本的Selenium下使用WebDriverWait的时候,发现找不到ExpectedConditions。有一个比较简单的方法就是
阅读全文
摘要://取出Cookie,当登录后才能取 [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, Stri...
阅读全文
摘要:WebBrowser方法如下 AxWebBrowser方法如下
阅读全文
摘要:private void axWebBrowser1_NewWindow2(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) { AxSHDocVw.AxWebBrowser _axWebBrowser = CreateNewWebBrowser(); e....
阅读全文
摘要:var sNumbers = "1,2,3,4,5,6"; List numbers = sNumbers.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse).ToList();
阅读全文
摘要:string a = "a1a2a3a4"; Regex reg1 = new Regex(@"]+>([^]+)]+>", RegexOptions.IgnoreCase);//此用于取一个时,不是集合时应用。 string str = reg1.Match(a).Groups[1].Value; ...
阅读全文
摘要:StringBuilder builder=new StringBuilder(); builder.AppendLine("{"); builder.AppendLine("\"key1\":\"value1\","); builder.AppendLine("\"key2\":\"value2\","); builder.AppendLine("\"key3\":\"value3\",");.
阅读全文