Quantcast
Channel: 木子屋 - Win编程
Browsing all 206 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

qAdmin:cannot perform this operation on a closed dataset解决方法

SQLite Administrator打开和创建SQLite数据库有时会出错,提示: 引用内容qAdmin:cannot perform this operation on a closed dataset出现这种情况时,一般是SQLite数据库存放路径中含有中文字符,将数据库移到英文路径下即可。

View Article


Image may be NSFW.
Clik here to view.

Linq to SQlite出错"未将对象引用设置到对象的实例"解决方法

Linq to SQlite使用DbLinq2008生成数据库上下文类,SQLite for .NET版本为sqlite-netFx35-binary-bundle-Win32-2008-1.0.109.0,项目生成正常,启动出错,提示未将对象引用设置到对象的实例:我们知道,这一般是对空对象(null)进行操作引发的错误,但检查程序没有空对象,程序简化如下:复制内容到剪贴板...

View Article


Image may be NSFW.
Clik here to view.

Windows下云主机+frp内网穿透实现WEB访问和远程桌面示例

前提条件:frp内网穿透需一台拥有固定公网IP的电脑做为中转节点(服务器),云主机传送门:www.aliyun.com。一、公网(服务器端)电脑设置将frps.exe和frps.ini两个文件复制到服务器端电脑,打开frps.ini文件内容修改为:复制内容到剪贴板 程序代码[common]bind_port = 7000vhost_http_port =...

View Article

Image may be NSFW.
Clik here to view.

Eclipse和JDK版本对应关系及历史版本下载

高版本Eclipse+低版本JDK可能会出现诸如Java...

View Article

Image may be NSFW.
Clik here to view.

C#远程终端控件AxMsTscAxNotSafeForScripting使用示例

Visual Studio 2017新建一个Windows窗体项目,打开菜单"工具->选择工具箱项",选择COM组件"Microsoft Terminal Services Client Control - version 1":从工具箱中将Microsoft Terminal Services Client Control - version 1组件拖到窗体,编写如下代码:复制内容到剪贴板...

View Article


Image may be NSFW.
Clik here to view.

C#远程桌面控件AxMsRdpClientNotSafeForScripting使用示例

Visual Studio 2017新建一个Windows窗体项目,打开菜单"工具->选择工具箱项",选择COM组件"Microsoft RDP Client Control -version 2":从工具箱中将Microsoft RDP Client Control -version 2组件拖到窗体,编写如下代码:复制内容到剪贴板 程序代码private void...

View Article

Image may be NSFW.
Clik here to view.

C#执行exe三种方法

第一种方法(静态方法):复制内容到剪贴板 程序代码System.Diagnostics.Process.Start("cmd.exe");第二种方法(静态方法):复制内容到剪贴板 程序代码System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("cmd.exe");info.FileName...

View Article

Image may be NSFW.
Clik here to view.

Windows PowerShell 入门

Windows PowerShell 是专门为系统管理员设计的 Windows 命令行 Shell。 Windows PowerShell 包括可以单独或组合使用的交互提示和脚本编写环境。与大多数 Shell(它们接受和返回文本)不同,Windows PowerShell 是在 .NET Framework 公共语言运行时 (CLR) 和.NET Framework 的基础上生成的,它将接受和返回...

View Article


Image may be NSFW.
Clik here to view.

PowerShell的条件判断语句和循环语句

1、if条件判断语句复制内容到剪贴板 程序代码if(1 -lt 2) { echo "true"} else {echo "false"} 引用内容true2、for循环语句复制内容到剪贴板 程序代码for($i=1;$i -le 5;$i++){echo $i} 引用内容123453、while循环语句复制内容到剪贴板 程序代码$i=1;for(;$i -le 5;){echo $i;$i++;}...

View Article


Image may be NSFW.
Clik here to view.

C#发送邮件失败命令顺序不正确need EHLO and AUTH first解决方法

C#使用QQ邮箱发送邮件,同样的程序,以前正常运行,今天运行失败,提示:复制内容到剪贴板 程序代码System.Net.Mail.SmtpException:“命令顺序不正确。 服务器响应为:Error: need EHLO and AUTH first...

View Article

Image may be NSFW.
Clik here to view.

C#发送邮件时在正文插入图片示例

复制内容到剪贴板 程序代码//using System.Net;//using System.Net.Mail;//using System.Text;//邮件MailMessage mailMessage = new MailMessage(){    Priority = MailPriority.Normal,    SubjectEncoding = Encoding.UTF8,...

View Article

Image may be NSFW.
Clik here to view.

WinForm屏幕/窗体/控件截图方法[转]

复制内容到剪贴板 程序代码using System;using System.Drawing;using System.Runtime.InteropServices;using System.Windows.Forms;namespace FederalCredit{    public class MZCapture    {        #region  DLL calls...

View Article

Image may be NSFW.
Clik here to view.

C#实用扩展方法整理收集

复制内容到剪贴板 程序代码using System;using System.Text.RegularExpressions;namespace mzwu_com{    static class Extensions    {        /// <summary>        /// 取两个字符串中间的字符串        /// </summary>...

View Article


Image may be NSFW.
Clik here to view.

C#生成远程桌面rdp文件示例

复制内容到剪贴板 程序代码using System;using System.IO;using System.Runtime.InteropServices;using System.Text;namespace ConsoleApp1{    public static class RDPHelper    {        [StructLayout(LayoutKind.Sequential,...

View Article

Image may be NSFW.
Clik here to view.

C#检测远程计算机指定端口是否打开的方法

1、Socket.Connect检测远程计算机指定端口是否打开复制内容到剪贴板 程序代码public bool CheckRemotePort(string ipAddress, int port){    bool result = false;    try    {        IPAddress ip = IPAddress.Parse(ipAddress);...

View Article


Image may be NSFW.
Clik here to view.

C#使用throw和throw ex抛出异常两者的区别[转]

我们都知道,C#中使用throw和throw ex抛出异常,但二者是有区别的。C#推荐使用throw来抛出异常,throw...

View Article

Image may be NSFW.
Clik here to view.

C#查找运行中的应用程序并将其显示到前端

复制内容到剪贴板 程序代码using System;using System.Diagnostics;using System.Runtime.InteropServices;namespace ConsoleApp1{    class Program    {        private const int SW_HIDE = 0;        private const int...

View Article


Image may be NSFW.
Clik here to view.

消除WinForm回车光标移到下一个控件时发出声音的方法

在WinForm中为了方便用户操作,我们常常会这样做,比如用户登录界面,当输入完用户名按回车光标自动移到密码输入框,输入密码按回车就能执行登录,这只需在TextBox控件的KeyDown事件中加入相关判断和操作即可,但是试过的朋友会知道,这样的话按完回车键会发出咚的一声,像我这样的重度强迫症患者表示接受不了:复制内容到剪贴板 程序代码private void...

View Article

Image may be NSFW.
Clik here to view.

C#未能加载文件或程序集WMPLib:生成此程序集的运行时比当前加载的运行时新解决方法

前几年写的一个WinForm应用程序,引用了COM组件Windows Media Player用于播放音频文件,今天用VS2019编辑生成后运行出错,提示: 引用内容System.BadImageFormatException: 未能加载文件或程序集“AxInterop.WMPLib, Version=1.0.0.0, Culture=neutral,...

View Article

Image may be NSFW.
Clik here to view.

一键卸载NuGet程序包及其依赖项示例

有时引用的NuGet程序包有好几个依赖项,卸载的时候一个个卸载花时间不说,还要注意先后顺序很麻烦。例如我们引用System.Data.SQLite,它的依赖项就有4个:...

View Article
Browsing all 206 articles
Browse latest View live