这是一个C#实现的屏幕抓取程序,可以抓取整个屏幕保存为指定格式的图片,并且保存当前控制台缓存到文本using System;using System.Collections.Generic;using System.ComponentModel;using System.Diagnostics;using System.Drawing;usin……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2055浏览 1427个赞
C#检测指定的URL网址是否可用,相当于一个针对网址的ping操作,非常实用using System;using System.Media;using System.Net;using System.Threading;namespace RobvanderWoude{ class PingSite { static bool beep……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1255浏览 538个赞
此代码可以返回指定PDF文件有多少页using System;using System.IO;using System.Text.RegularExpressions;using System.Windows.Forms;namespace RobvanderWoude{ class PDFPageCount { static int ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2026浏览 597个赞
C#从windows剪贴板获取并显示文本内容using System;using System.Windows.Forms;namespace RobvanderWoude{ class Paste { [STAThread] static int Main( string[] args ) { if ( args.Lengt……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1747浏览 2526个赞
这段代码可以在指定的目录创建一个字节为0的临时文件using System;using System.IO;namespace RobvandeWoude{ class NewTempFile { static int Main( string[] args ) { if ( args.Length > 0 ) { ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2734浏览 1051个赞
C#代码将指定目录的所有文件名转换成小写using System;using System.IO;using System.Linq;namespace RobvanderWoude{ class LoCase { static int Main( string[] args ) { string dir = string.Em……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2430浏览 1773个赞
C#控制台列出当前所有可用的打印机列表// The initial C# code for the WMI query was generated by WMI Code Generator, Version 5.00, http://www.robvanderwoude.com/wmigen.phpusing System;using System……继续阅读 » 水墨上仙 4年前 (2021-03-12) 3077浏览 1261个赞
C#列出所有物理网络适配器using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Management;using System.Text;namespace RobvanderWoude{ ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2645浏览 694个赞
C#返回当前系统所有可用驱动器符号// The initial C# code for the "plain" WMI query was generated by// WMI Code Generator, Version 5.00, http://www.robvanderwoude.com/wmigen.phpusing S……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1555浏览 738个赞
C#判断指定分区是否是ntfs格式using System;using System.IO;namespace RobvanderWoude{ class IsNTFS { public static int Main( string[] args ) { try { if ( args.Length == 0 )……继续阅读 » 水墨上仙 4年前 (2021-03-12) 3150浏览 2024个赞
C#返回指定驱动器是否是Fat分区格式using System;using System.IO;namespace RobvanderWoude{ class IsFAT { public static int Main( string[] args ) { try { if ( args.Length == 0 )……继续阅读 » 水墨上仙 4年前 (2021-03-12) 3171浏览 2957个赞
C#判断当前系统是32位还是64位// The initial C# code for the "plain" WMI query was generated by WMI Code Generator, Version 5.00, http://www.robvanderwoude.com/wmigen.phpusing Syst……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2777浏览 827个赞
C#隐藏控制台的键盘输入using System;namespace RobvanderWoude{ class HideInput { static int Main( string[] args ) { try { bool clearscreen = false; if ( args.Length >……继续阅读 » 水墨上仙 4年前 (2021-03-12) 3056浏览 2564个赞
C#获得父进程PID编号的完整源代码using System;using System.Diagnostics;namespace RobvanderWoude{ class GetMyPID { static int Main( string[] args ) { #region Command Line Parsing ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2554浏览 615个赞
C#实现的FastPing代码,知己开发一个ping的工具using System;using System.Net.NetworkInformation;namespace RobvanderWoude{ class FastPing { static int Main( string[] args ) { try { ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1949浏览 2600个赞
C#获得本机可用驱动器编号列表using System;using System.Collections.Generic;using System.IO;namespace RobvanderWoude{ class Drives { static int Main( string[] args ) { bool showuse……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1987浏览 512个赞
C#编写的一个简单的命令行计算器代码using System;using System.CodeDom.Compiler;using System.Globalization;using System.Reflection;using System.Threading;namespace RobvanderWoude{ class ClCa……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2230浏览 2000个赞
一个自定义Sql Server字符串分割函数split,类似C#里的split函数,功能虽然不是很强大,应付一般的问题足矣 函数定义Create function [dbo].[split](@SourceSql varchar(max),@StrSeprate varcha……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1865浏览 2330个赞
Sql Server定义一个字符串分割函数,类似于C#里的split函数下面的代码使用了临时表作create function f_split(@c varchar(2000),@split varchar(2)) returns @t table(col varchar(20)) as begin……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1249浏览 2516个赞
C#从远程服务器获得本机的上网ipusing System;using System.IO;using System.Net;using System.Text.RegularExpressions;namespace RobvanderWoude{ class WANIP { static int Main( string[] arg……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1238浏览 592个赞
C#随机设置900-1100毫秒的延迟using System;using System.Threading;///<summary>/// A time delay of 900..1100 milliseconds///</summary>namespace RobvanderWoude{ class WaitA……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2987浏览 2103个赞
C#将制定目录的文件名都转换成大写using System;using System.IO;using System.Linq;namespace RobvanderWoude{ class UpCase { static int Main( string[] args ) { string dir = string.Empty……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1728浏览 704个赞
C#重定向标准输入到标准输出using System;using System.IO;using System.Runtime.InteropServices;namespace RobvanderWoude{ class Tee { static int Main( string[] args ) { #region Comm……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2605浏览 780个赞
C#读取文件或者字符流的最后几行,类似linux的tail命令using System;using System.Collections.Generic;using System.IO;using System.Runtime.InteropServices;namespace RobvanderWoude{ class Tail { ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2945浏览 1730个赞
C#获取指定字符串的MD5和SHA*加密代码using System;using System.Text;using System.Security.Cryptography;namespace StringHash{ class StringHash { static int Main(string[] args) { try……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2487浏览 583个赞
C#读取或者设置ScrollLock状态,允许滚动状态读取或者设置using System;using System.Runtime.InteropServices;using System.Windows.Forms;namespace RobvanderWoude{ public class ScrollLock { [DllImpo……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2890浏览 2045个赞
C#在多行字符串中查找指定信息,类似linux下的grep功能using System;using System.IO;using System.Runtime.InteropServices;using System.Text.RegularExpressions;namespace RobvanderWoude{ class Rx……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1928浏览 2378个赞
C# 修改指定文件的最后修改时间的时间戳using System;using System.IO;using System.Linq;namespace RobvanderWoude{ class CloneDate { static int Main( string[] args ) { bool debug = false;……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1958浏览 2293个赞
C# 读取和设置大小写切换键状态可以通过程序查看或者设置当前键盘上的Capslock健的状态是否打开using System;using System.Runtime.InteropServices;using System.Windows.Forms;namespace RobvanderWoude{ public class CapsLoc……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1285浏览 1504个赞
C#返回指定ASCII码的十进制字符using System;namespace RobvanderWoude{ class Asc { static int Main( string[] args ) { if ( args.Length != 1 ) { return WriteError( string.Empt……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1349浏览 1006个赞
在运行时反射是程序检查其所拥有的结构,尤其是类型的一种能力;这是元编程的一种形式。它同时也是造成混淆的重要来源。在这篇文章中将试图明确解释在 Go 中的反射是如何工作的。每个语言的反射模型都不同(同时许多语言根本不支持反射)。不过这篇文章是关于 Go 的,因此接下来的内容“反射”这一词表示“在 Go 中的反射”。转自:http://www.mikespook……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1306浏览 2521个赞
使用前请先引用:ThoughtWorks.QRCode.Codecusing ThoughtWorks.QRCode.Codec; //content = "欢迎光临75271.com"; QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2061浏览 2761个赞
背包问题(Knapsack problem)的描述为:给定一组物品,每种物品都有自己的重量和价格,在限定的总重量内,我们如何选择,才能使得物品的总价格最高class Item { public int weigth; public int price; } static int ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2589浏览 938个赞
C#动态规划解决0-1背包问题转自:http://blog.csdn.net/smart819819/article/details/8694272// 利用动态规划解决0-1背包问题using System;using System.Collections.Generic;using System.Linq;using System.Text;……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1489浏览 1781个赞
C#通过QRCode生成二维码public class QRCode { /// <summary> /// 根据ID生成一个二维码 /// /// </summary> /// <param name="cardID">&l……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2097浏览 1229个赞
编辑距离的算法是首先由俄国科学家Levenshtein提出的,故又叫 Levenshtein Distance。一个字符串可以通过增加一个字符,删除一个字符,替换一个字符得到另外一个字符串,假设,我们把从字符串A转换成字符串B,前面3种操作所执行的最少次数称为AB相似度 如 abc adc 度为 1 ababababa babababab 度……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1349浏览 126个赞
C#字符串相似度比较编辑距离算法最先是由俄国科学家Levenshtein提出的,所以这个算法也叫做Levenshtein Distance算法。用最简单的一句话来说明这个算法就是:通过插入、删除、替换方法将字符串A变成字符串B所有的步骤就是算法中提到的编辑距离,最简单的相似度即编辑距离的倒数。代码转自:http://blog.csdn.net/yangzho……继续阅读 » 水墨上仙 4年前 (2021-03-12) 3004浏览 2682个赞
C#通过编辑距离算法实现字符串相似度比较编辑距离:通过插入、删除、替换一个字符(和交换相邻字符)的操作,使得字符串A和字符串B相同,而最少的操作次数就是编辑距离。如字符串abcd和aca的距离是2public class LevenshteinDistance { private static LevenshteinDistanc……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1498浏览 2551个赞
使用OFFICE 的Excel 自动化服务来生成Excel文件的办法,也就是使用Excel提供的Com对象public static void CreateExcel() { for(int i = 0 ; i<1 ; i++) { string staFile = "D:\\test\\x"; ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1381浏览 2546个赞
回文:称正读和反读都相同的字符序列为“回文”,如“abba”、“abccba”、12321、123321是“回文”,“abcde”和“ababab”则不是“回文”。//--------------------------算法三:-----------Console.WriteLine("算法3:请输入一个字符串!");string……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2415浏览 2352个赞
回文:称正读和反读都相同的字符序列为“回文”,如“abba”、“abccba”、12321、123321是“回文”,“abcde”和“ababab”则不是“回文”。// ------------------算法二:利用栈先进后出,队列先进先出的特点----------------//abbaConsole.WriteLine("算法2:请输……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2624浏览 1166个赞
C#进行回文检测,判断字符串是否是回文回文:称正读和反读都相同的字符序列为“回文”,如“abba”、“abccba”、12321、123321是“回文”,“abcde”和“ababab”则不是“回文”。// --------------- 算法一:根据数组元素----------------------------Console.WriteLine(&……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2328浏览 1504个赞
C# 自定义堆栈进行回文检测转自:http://blog.csdn.net/haifengzhilian/article/details/8848477using System; using System.Collections; namespace CStack { class Program { ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1822浏览 1967个赞
字符串相似度算法(编辑距离算法 Levenshtein Distance)原理及C#代码实现转自:http://www.deepleo.com/archives/220 编辑距离,又称Levenshtein距离(也叫做Edit Distance),是指两个字串之间,由一……继续阅读 » 水墨上仙 4年前 (2021-03-12) 1462浏览 1663个赞
C#回溯法解决背包问题转自:http://hi.baidu.com/y_x_b_s/item/8c518a1c1eb970446926bbb3using System;using System.Collections.Generic;using System.Text;namespace BackRack{ //要装入书包的货物节点 ……继续阅读 » 水墨上仙 4年前 (2021-03-12) 2368浏览 572个赞