c#
guoruijun_2012_4
这个作者很懒,什么都没留下…
展开
-
c#调用bittorrent
参考链接:https://github.com/SamuelFisher/torrentcore原创 2020-12-25 17:02:09 · 153 阅读 · 0 评论 -
.net 资料 查找
参考https://blog.csdn.net/LANCEWENLONG/article/details/51324276原创 2020-11-24 15:34:22 · 90 阅读 · 0 评论 -
c# socket KeepAlive 心跳
using System;using System.IO;using System.Net;using System.Net.Sockets;namespace SocketKeepAliveSharp{ class Program { /// <summary> /// main /// </summary> /// <param name="args"></param&g转载 2020-11-23 09:48:46 · 2090 阅读 · 0 评论 -
c#获取 windows系统版本号和系统名称
//----------------- //C#判断操作系统是否为Windows98 public static bool IsWindows98 { get { return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.M原创 2020-11-22 19:44:44 · 1423 阅读 · 0 评论 -
c# ini file
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;namespace setup{ public struct IniValue { private static bool TryParseInt(string text, out int value)转载 2020-11-18 21:15:34 · 371 阅读 · 0 评论 -
关闭窗体隐藏到托盘
#region Close the form hidden to the tray private void menu_FormClosing(object sender, FormClosingEventArgs e) { //Notice that the Reason for the close event comes from the form button, otherwise you cannot exit when you...转载 2020-11-17 14:46:53 · 166 阅读 · 0 评论 -
timer monitor service
#region timer monitor service private void timer1_Tick(object sender, EventArgs e) { if (ZooKeeperServerStatus()) { zookeeperLabel.Text = "normal"; } else { .原创 2020-11-17 14:27:12 · 180 阅读 · 0 评论 -
c# 安装windows例子
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Linq;using System.Management;using System.ServiceProcess;using System.Text;namespace KafkaService{ public parti转载 2020-11-15 22:03:03 · 122 阅读 · 0 评论 -
c#安装windows服务
参考:执行步骤部分代码:using System;using System.Collections;using System.Collections.Generic;using System.ComponentModel;using System.Configuration.Install;using System.Data;using System.Drawing;using System.IO;using System.Linq;using System.ServiceProce原创 2020-11-15 19:10:17 · 627 阅读 · 0 评论 -
拉姆达表达式 Lambda 表达式(lambda expression)
public string businessTypeInput { get => businessType; set => businessType = value; }public string businessTypeInput { get { return businessType;} set { businessType = value;} }原创 2020-11-13 10:38:03 · 417 阅读 · 0 评论 -
c# 简单 启动 画面
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1{ public partial class Form1 : F原创 2020-11-10 10:06:25 · 275 阅读 · 0 评论 -
c#获取执行文件所在的盘符
1、System.Windows.Forms.Application.StartupPath;2、System.AppDomain.CurrentDomain.BaseDirectory;3、System.Environment.CurrentDirectory;以上bai三du种zhi方法都可以获取程dao序根目录,4102string programPath=以上三者选一。string volume = programPath.Substring(0, System.Windows.Forms转载 2020-11-09 09:55:25 · 1849 阅读 · 0 评论 -
vs2010 把 .netframework 一起打入安装包 步骤
.netframework文件夹下的项目原创 2020-11-06 22:03:07 · 612 阅读 · 0 评论 -
c#调用cmd命令执行java编译后的jar
1、c#调用cmd命令例子 public static bool OpenChannel() { string strDirectory = System.AppDomain.CurrentDomain.BaseDirectory; Process proc = new Process(); proc.StartInfo.CreateNoWindow = true; proc.StartInf原创 2020-11-02 11:51:53 · 591 阅读 · 0 评论 -
c#调用cmd命令java环境监测
#region java环境监测 public static bool JreInstalled() { try { Process p = new Process(); p.StartInfo.FileName = "java.exe"; p.StartInfo.Arguments = "-version"; ...原创 2020-10-30 17:18:44 · 164 阅读 · 0 评论 -
c# 调用 cm命令阻塞解决办法
public static bool OpenChannel() { string strDirectory = System.AppDomain.CurrentDomain.BaseDirectory; Process proc = new Process(); proc.StartInfo.CreateNoWindow = true; proc.StartInfo.FileName = "c.原创 2020-10-30 17:16:36 · 236 阅读 · 0 评论 -
c# window java 8 环境 变量 设定
public static void SetEnvironment() { string strDirectory = System.AppDomain.CurrentDomain.BaseDirectory; if (Environment.GetEnvironmentVariable("JAVA_HOME", EnvironmentVariableTarget.User)==null ||!Environme原创 2020-10-30 17:11:45 · 69 阅读 · 0 评论 -
c#调用exe获取返回值
static void Main(string[] args) { object output; try { using (Process p = new Process()) { p.StartInfo.FileName = @"ConsoleApp2.exe";//可执行程序路径 ...转载 2020-10-26 22:50:19 · 3994 阅读 · 0 评论 -
c#设置java环境变量
string temp = strDirectory + "baseDir\\jdk1.8.0_202"; string sPath = Environment.GetEnvironmentVariable("JAVA_HOME"); //获取环境变量 System.Environment.SetEnvironmentVariable("JAVA_HOME", temp, EnvironmentVariableTarget.Machin...原创 2020-10-22 09:44:16 · 425 阅读 · 0 评论 -
c#读取 word 内容
using Microsoft.Office.Interop.Word; private void button2_Click(object sender, EventArgs e) { FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "请选择文件路径"; string foldPath;转载 2020-10-22 08:40:49 · 747 阅读 · 1 评论 -
c# 正则表达式 截取 文本 中 指定 内容
/// 截取字符串中开始和结束字符串中间的字符串 /// </summary> /// <param name="source">源字符串</param> /// <param name="startStr">开始字符串</param> /// <param name="endStr">结束字符串</param> /// <...转载 2020-10-22 08:38:24 · 2084 阅读 · 0 评论 -
c#文件筛查
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace fileCheck{原创 2020-10-21 10:54:15 · 179 阅读 · 0 评论 -
c# 表数据去重处理
#region 去重处理 static public void Distinct(string tableName) { string sqlCmd= " delete from tdly." + tableName + " where rowid in (select rid ...转载 2019-09-02 17:17:32 · 470 阅读 · 0 评论 -
c#打开关闭网卡
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Management;using Syst...转载 2019-08-14 11:19:11 · 708 阅读 · 0 评论 -
c# datetime 时间加一天减一天
//获取日期+时间DateTime.Now.ToString(); // 2008-9-4 20:02:10DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12//获取日期DateTime.Now.ToLongDateString().ToString(); // 2008年9月4...转载 2019-10-11 09:22:51 · 3915 阅读 · 0 评论 -
c# 把字符串转换成 byte 的二进制流 把字节流写入文件
#region 把字符串转换成 byte 的二进制流。 /// <summary> /// 把字符串转换成 byte 的二进制流。 /// </summary> /// <param name="strmemo"></param> /// <param name=...转载 2019-08-29 15:05:40 · 4121 阅读 · 0 评论 -
c# 文件夹文件数统计
#region 文件数取得 public static int GetFilesCount(System.IO.DirectoryInfo dirInfo) { int totalFile = 0; totalFile += dirInfo.GetFiles().Length; ...原创 2019-08-29 11:53:06 · 1453 阅读 · 0 评论 -
sql c# 表数据去除重复记录
#region 去重处理 static public void Distinct(string tableName) { string sqlCmd = " delete from tdly." + tableName + " where rowid in (select rid...转载 2019-08-28 17:57:39 · 973 阅读 · 0 评论 -
c# 写log
#region 写log public static void WriteLogToFile(string msg) { string strDic = System.AppDomain.CurrentDomain.BaseDirectory; IniMen readIdent = new IniMen(); ...转载 2019-08-28 17:51:21 · 529 阅读 · 0 评论 -
c# 根据“精确进程名”结束进程,杀进程
/// <summary> /// 根据“精确进程名”结束进程 /// </summary> /// <param name="strProcName">精确进程名</param> public void KillProc(string strProcName) { ...原创 2019-08-28 17:48:00 · 837 阅读 · 0 评论 -
c#写 log方法
public static void WriteLogToFileDiffTable(string msg) { string strDic = System.AppDomain.CurrentDomain.BaseDirectory; IniMen readIdent = new IniMen(); ...转载 2018-12-29 17:10:36 · 2079 阅读 · 0 评论 -
c# Process cmd 开机自启动 时异常退出 不执行 问题
public static string ExecuteDosCmd(string dosCommand, int milliseconds) { //输出字符串 string output = &amp;quot;&amp;quot;; if (dosCommand != null &amp;amp;amp;&amp;am原创 2018-12-28 11:07:42 · 721 阅读 · 0 评论 -
c# 调用 执行 dos 命令
using System;using System.Collections.Generic;using System.Text;using System.Management;using System.Diagnostics;using System.Windows.Forms;using System.IO;namespace serviceConfig{ public...转载 2019-08-29 15:35:12 · 379 阅读 · 0 评论 -
c#设置服务启动停止
using System;using System.Collections.Generic;using System.Text;using System.ServiceProcess;using Microsoft.Win32;namespace serviceConfig{ class ClServCtl { /// <summary>...转载 2019-08-29 15:39:42 · 366 阅读 · 0 评论 -
c# ping 命令 判断 ip 是否可以访问
Ping ping = new Ping(); //ping服务器内网ip PingReply pingReply = ping.Send("100.251.125.126"); if (pingReply.Status == IPStatus.Success) ...转载 2019-09-25 14:58:08 · 420 阅读 · 0 评论 -
c#,timer监测文件夹文件变化,按时间差查看文件变化列表
private void timerFilesName_Tick(object sender, EventArgs e) { List<string> listSubtraction = new List<string> { }; List<string> list1 = ...原创 2019-09-23 11:07:10 · 454 阅读 · 0 评论 -
c# xml Attributes[ ].Value 空值 判断
static private bool parseXmlListInsert(XmlNodeList nodeList, string str) { try { if (nodeList != null && nodeList.Count != 0) ...原创 2019-09-04 11:50:56 · 1266 阅读 · 0 评论 -
c# Merge表
#region Merge表 static public void Merge(string tableName) { //merge into 语法例 /* * merge into * dtjc.t_gdxm new_gdxm ...转载 2019-09-02 17:29:54 · 456 阅读 · 0 评论 -
c# truncate 表数据
#region truncate 表数据 //清空表数据,导入临时表前,把旧数据清除。 static private void truncateData() { ArrayList aList = new ArrayList(); string[] strArr = { "T_BPGY","table...转载 2019-09-02 17:15:30 · 1042 阅读 · 0 评论 -
c# 文件名递归获取
#region 文件名递归获取 /// <summary> /// 获取指定目录中的匹配项(文件或目录) /// </summary> /// <param name="dir">要搜索的目录</param> /// <param name="reg...转载 2019-09-02 16:57:09 · 145 阅读 · 0 评论