NetBlog主题

数据库SQL注入攻击以及解决方案
数据库

数据库SQL注入攻击以及解决方案

4154

--数据库SQL注入攻击select count(*) from 表 where LoginID='lqwvje' and pwd='123'--拿上面的一个经常用的用户登入实例 正常情况下是没有问题 count0即可以登入成功--用户名一但输入了数据库特殊字符如一下 一段代码 那就可以正常登入select count(*) from 表 where Lo…

解决WinForm tableLayoutPanel 里面数据在刷新时边框闪动
WinForm技巧

解决WinForm tableLayoutPanel 里面数据在刷新时边框闪动

5547

tableLayoutPanel 里面的Lable值发生变动频繁时 边框会闪动解决是在窗体加载时添加以下代码即可,本人亲自用过,很管用private void Form1_Load(object sender, EventArgs e) { //tableLayoutPanel1 是控件的名称tableLayoutPanel1.GetType().GetProperty("DoubleBuffer…

C# async/await 同步思维解决异步问题方案
C#基础

C# async/await 同步思维解决异步问题方案

4197

下面是一个代码实例 static void Main() {Console.WriteLine("-------主线程启动-------");GetStrLengthAsync();Console.WriteLine("主线程继续执行");Console.WriteLine("-------主线程结束-------");Console.Read(); } static async void Get…

解决 .net Core 3.1中使用GB2312编码异常
.Net Core

解决 .net Core 3.1中使用GB2312编码异常

6586

在.net core使用GB2312时抛出以下异常 System.ArgumentException:“'gb2312' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. 解决方法 在NuGet 添加“System.Text.Enco…

解决Android 连续多次点击   Toast 重复显示
Android基础

解决Android 连续多次点击 Toast 重复显示

4705

在这里我封装好了一个类 import android.content.Context; import android.widget.Toast;public class ToastUtil {private static Toast mToast;public static void ShowMsg(Context context, String msg,int duration) {if (mToast == null) {mToast = Toast.makeText(contex…

C#,WinForm窗体应用程序只能运行一个解决方案
WinForm技巧

C#,WinForm窗体应用程序只能运行一个解决方案

4623

有些软件不想在同一台电脑上运行两个可以用以下方法在Program.cs类里面写上以下代码即可/// <summary>/// 应用程序的主入口点。/// </summary>[STAThread]static void Main(){bool ret;System.Threading.Mutex mutex = new System.Threading.Mutex(true, Applicat…