自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

蜂巢

大自然的搬运工

  • 博客(23)
  • 资源 (4)
  • 收藏
  • 关注

原创 sqlserver导出表结构说明

SELECT表名=case when a.colorder=1 then d.name else ‘’ end,表说明=case when a.colorder=1 then isnull(f.value,’’) else ‘’ end,字段序号=a.colorder,字段名=a.name,标识=case when COLUMNPROPERTY( a.id,a.name,‘IsIdentity’)=1 then ‘√’el

2021-03-23 13:01:15 309

原创 wpf 同比例缩放不影响布局

<Viewbox Visibility="Visible" Stretch="Fill"> <Canvas x:Name="canvas" Height="768" > 布局内容。。。 </Canvas></Viewbox>

2020-09-06 10:50:39 548

原创 通过http接口请求传递数据

/// <summary> /// 通过http请求传递数据(参数为model类型) /// </summary> /// <param name="url">传递数据的url</param> /// <param name="paraJson">要传递的Json数据</param> /// <param name="requestMethod">请求方法:GET/POST/P...

2020-09-06 10:45:15 1791

原创 C#实现阻止关闭显示器和系统待机

可以通过这个SetThreadExecutionState API实现阻止系统休眠。它在C#中的声明方式如下:[DllImport("kernel32.dll")]static extern uint SetThreadExecutionState(ExecutionFlag flags);[Flags]enum ExecutionFlag : uint{ System = 0x00000001, Display = 0x00000002, Continuous = 0x

2020-09-06 10:44:38 596

原创 wpf datagrid数据 导出到excel

public static void ExportToExcel(DataGrid dataGridView1, string sheetName){SaveFileDialog fileDialog = new SaveFileDialog();fileDialog.Filter = “Excel(97-2003)|*.xls”;if (fileDialog.ShowDialog() == false){return;}//不允许dataGridView显示添加行,负责导出时会报最后一行未

2020-08-08 19:18:48 522

转载 wpf 使用log4net记录日志

现在项目涉及的是cs客户端,在项目中使用log4net记录本地日志和异常信息,这里项目做完了,想着自己做一个demo,测试记录一下log4Net的配置使用。第一步、新建一个wpf应用程序,项目右键 -----》点击NuGet程序包 -----》搜索lognet -------》点击安装第二步:在app.config中添加节点 (当然,如果是Web项目就是 web.config)配置文件代码如下:复制代码

2020-07-27 12:47:25 4499

转载 WPF自定义控件与样式(3)-TextBox & RichTextBox & PasswordBox样式、水印、Label标签、功能扩展

一.前言.预览申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接。本文主要是对文本输入控件进行样式开发,及相关扩展功能开发,主要内容包括:基本文本框TextBox控件样式及扩展功能,实现了样式、水印、Label标签、功能扩展;富文本框RichTextBox控件样式;密码输入框PasswordBox控件样式及扩展功能;效果图:二.基本文本框TextBox控件样式及扩展功能2.1 T

2020-07-20 19:06:32 620

原创 wpf 后台设置背景色16进制

new SolidColorBrush((Color)ColorConverter.ConvertFromString("#F0F0F0"));

2020-07-20 15:04:29 600

原创 C#中SetWindowPos函数详解 修改窗体

[DllImport(“user32.dll”)]private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndlnsertAfter, int X, int Y, int cx, int cy, uint Flags);SetWindowPos(hWnd: HWND; {窗口句柄}hWndInsertAfter: HWND; {窗口的 Z 顺序}X, Y: Integer; {位置}cx, cy: Integer; {大小}u

2020-07-17 17:35:09 1955

转载 c# 获取当前活动窗口句柄,获取窗口大小及位置 控制向窗体发送数据 操作窗体

需调用API函数需在开头引入命名空间using System.Runtime.InteropServices;获取当前窗口句柄:GetForegroundWindow()[DllImport(“user32.dll”, CharSet = CharSet.Auto, ExactSpelling = true)]public static extern IntPtr GetForegroundWindow();返回值类型是IntPtr,即为当前获得焦点窗口的句柄使用方法 : IntPtr m

2020-07-17 17:14:47 4753

转载 ffmpeg 实现多宫格效果,视频拼接合成

通过FFmpeg建立画布,以多宫格方式展现一下为执行命令-re -i 1.mp4-re -i 2.mp4-re -i 3.mp4-re -i 4.mp4-filter_complex“nullsrc=size=640x480 [base]; [0:v] setpts=PTS-STARTPTS,scale=320x240 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=320x240 [upperright];[2:v] setpt

2020-07-16 12:16:46 2142

原创 wpf 在windows Alt+Tab 任务视图中隐藏 定义为工具软件

#region 在windows Alt+Tab 任务视图中隐藏 定义为工具软件 [DllImport("user32.dll")] public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex); public static IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { int error ...

2020-07-14 17:22:50 410 1

原创 时间戳转为C#格式时间

/// /// 时间戳转为C#格式时间/// /// Unix时间戳格式/// C#格式时间public static DateTime GetStampDateTime(double timeStamp){DateTime time = new DateTime();try{DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));long lTime = long.Parse(

2020-07-14 16:36:52 153

原创 基于TCPIP在线更新文件客户端

int uptype = 2;//1 客户端 2管理端Thread threadClient = null; // 创建用于接收服务端消息的 线程;Socket sockClient = null;DispatcherTimer timer = new DispatcherTimer();DispatcherTimer timer2 = new DispatcherTimer();private void Window_Loaded(object sender, RoutedEventArgs e

2020-07-14 13:29:36 200

原创 基于TCPIP在线更新文件服务端

Thread threadWatch = null; // 负责监听客户端连接请求的 线程; Socket socketWatch = null; Dictionary<string, Socket> dict = new Dictionary<string, Socket>(); Dictionary<string, Thread> dictThread = new Dictionary<string, Thread>();

2020-07-14 13:28:08 198

原创 非正常word(网页保存htmlword)转docx

public void TranWordDocToDocx(string pathinfo, string file){Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();objec

2020-07-14 13:24:50 151

原创 验证应用是否重复打开

/// /// 验证重复打开应用/// /// public static bool IsRunning(){Process current = default(Process);current = System.Diagnostics.Process.GetCurrentProcess();Process[] processes = null;processes = System.Diagnostics.Process.GetProcessesByName(current.Process

2020-07-14 13:21:50 143

原创 C#删除word页眉页脚和最后一页

DirectoryInfo folder = new DirectoryInfo(tbr.Text); foreach (FileInfo file in folder.GetFiles("*.doc")) { //创建一个Document实例并加载示例文档 Spire.Doc.Document doc = new Spire.Doc.Document(); doc.LoadFromFile(fi

2020-07-14 13:16:57 1001

原创 wpf 控件跟随窗口大小调整比例

<Viewbox Stretch="Fill"> <Canvas Width="1280" Height="768"> <Grid Background="#FF009A8C" Height="727" Canvas.Left="1038"> //此处需要按比例调整的控件 </Grid > </Canvas> </Viewbo...

2020-07-14 12:02:08 2140

原创 C#设置文件夹权限,处理为Everyone所有权限

/// <summary> /// 设置文件夹权限,处理为Everyone所有权限 /// </summary> /// <param name="foldPath">文件夹路径</param> public static void SetFileRole(string foldPath) { DirectorySecurity fsec =...

2020-07-02 15:05:45 1302

原创 获取麦克风设备名称

public static List<string> GetInDeviceListFull() { List<string> devices = new List<string>(); var enumberator = new MMDeviceEnumerator(); var deviceCollection = enumberator.EnumerateAudi...

2020-07-02 15:04:19 1609

原创 appSettings配置

.config<?xml version="1.0" encoding="utf-8" ?> //////appSettings配置节的value项/////////public static string GetAppConfig(string strKey){foreach (string key in ConfigurationManager.AppSettings){if (key == strKey){return Con

2020-06-28 00:02:07 811

原创 DES加密 DES解密

/// <summary> /// DES加密 /// </summary> /// <param name="data">加密数据</param> /// <param name="key">8位字符的密钥字符串</param> /// <returns></returns> public static string DESEncrypt(string data.

2020-06-28 00:00:26 167

VLC_32位_64位

VLC_32位_64位

2020-07-25

视频推送录制的组件---ffmpeg

ffmpeg.exe—ffplay.exe—ffprobe.exe 视频录制 推送 处理必须的exe

2020-07-14

TCPIP更新文件.rar

TCPIP更新文件.rar

2020-07-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除