自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(39)
  • 收藏
  • 关注

原创 python 安装成功后终端显示的还是低版本

如果你下载了新版的 Python,但在使用时发现仍然是之前的版本,可能是因为新版的 Python 没有替代系统环境中的旧版 Python。

2023-10-28 19:17:50 2611

原创 关于Unity绑定手机

只需要在你的号码前+0就可以了,号码格式:+86+0+手机号码

2022-10-20 21:11:18 2694 3

原创 关于PyCharm 中使用sqlite创建数据库表,表不显示的问题

2021-06-18 17:01:17 1100

原创 C#执行sql语句

//SQL查询语句 public DataTable query(string sql) { DataTable dt=new DataTable(); string connString = "server=IP;uid=sa;pwd=;database=数据库名"; SqlConnection conn = new SqlConnection(connString); SqlDataAdapter adapter = new SqlDataAdapter(sql,con.

2020-06-12 17:30:16 530

转载 Unity中的贝塞尔曲线思路及实现(转)

转https://blog.csdn.net/GhostOrange/article/details/53613372那天突然在宣雨松的博客里看到了关于贝塞尔曲线的内容,然后发现根本无法理解他的代码,然后上网搜索了下,发现了以下漂亮的动图,于是乎我决定搞点事情。说到贝塞尔曲线,大家肯定不会陌生,很多插件都有它的身影,但是想要一窥它的细节总觉得有点困难,因为一到网上查询都是什么看不懂的公式啊(大神就不一样了),多项式啊吧啦吧啦的,说起多项式,估计大多数人都是感觉好像似曾相识,但是如果想要根据这些公式什

2020-06-01 16:11:02 778

原创 C#拆装箱

知道一点记一点装箱:值类型转化为objectint num=3;string str=" "+num;//产生了装箱操作string str=" "+num.ToString();//未产生装箱操作拆箱:object转化为值类型...

2019-12-07 13:40:33 188

原创 c#中decimal ,double,float的一些区别

单精度就是指4个字节的浮点数,即float双精度就是指8个字节的浮点数,即doubledecimal是高精度float num1=3.0f;float num2=2.9f;float result=num1-num2;bool b1=result==0.1f;Console.WriteLine(b1); false//因为精确度不够decimal num1=3.0m;d...

2019-11-26 11:38:00 668

转载 unity 自动寻路显示剩余路径

using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.AI;[RequireComponent(typeof(NavMeshAgent))]public class test : MonoBehaviour{ NavMeshAgent m_Ag...

2019-06-05 13:22:47 507

转载 MySQL 电脑重启后连接不上 输入密码后直接关闭对话框

以下的方法,是网上搜索到的方法方法一:若出现输入密码闪屏情况,首先要检查mysql的服务是否启动,,查看的方法是:右键“我的电脑”->“管理”->“服务和应用程序”->“服务” 查看mysql 的服务的状态,若没有启动,则右键启动服务。再次启动界面,输入密码查看是否可以,一般mysql服务没有开启是主要原因。这种原因的诱因很多,本人上次在使用某免费杀毒软件优化以后,mysq...

2019-05-14 10:32:25 2324 1

原创 Unity 场景切换变暗

Window>>lighting>>Settings>>Scene面板>>右下角Generate Lighting按钮前,取消勾选auto,这时候是没有烘焙灯光的情形,重新加载场景后不再会变暗。如果需要烘培灯光,则点击Generate Lighting按钮即可,这时候将保存光照贴图信息,重新加载后也不会再变暗。...

2019-04-16 18:08:40 2137 2

转载 WinForm窗体及其控件的自适应

1.在需要自适应的Form中实例化全局变量   AutoSizeFormClass.cs源码在下方     AutoSizeFormClass asc = new AutoSizeFormClass();2.Form_Load事件中       asc.controllInitializeSize(this);3.Page_SizeChanged事件中     asc.cont...

2019-02-27 17:08:26 316

原创 CheckedListBox控件单击勾选

把属性CheckOnClick设为true

2019-01-29 09:17:40 2030

原创 C# 委托简单介绍

using System;using System.Collections.Generic;using System.Linq;using System.IO;using System.Text;using System.Threading.Tasks;namespace TestDelegate{      class Program    {            ...

2019-01-24 14:32:22 160

转载 C# string字符串插值(使用前缀$)

C#  引入了字符串前缀$的字符串插值。string s = "hello";string y = $"{s} world";等同于使用Format方法:string y = string.Format("{0} world",s);并且我们可以调用值的方法,如:string y = $"{s.ToLower()} world";使用新的字符串格式代码可读性要好一些如:...

2019-01-22 09:22:04 548

原创 System.InvalidOperationException:“线程间操作无效: 从不是创建控件“label1”的线程访问它。”

  private void Form1_Load(object sender, EventArgs e)        {            //加载时 取消跨线程检查            Control.CheckForIllegalCrossThreadCalls = false;        }...

2019-01-10 14:50:43 2959

原创 C# 连接Redis

使用 工具-->>nuget 添加 StackExchange.Redis单个Redis客户端:// 以StackOverflow.Redis的开源项目为例ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("Redis1_IP地址:端口,password=密码");// 创建NoSQL数据库IData...

2019-01-09 12:09:51 2238

转载 C# 创建INI文件,写入并可读取

 using System.Text;using System.IO;using System.Runtime.InteropServices;namespace HotelSystemORM.Unitl{public class IniFiles {public string inipath;//声明API函数[DllImport("kernel32")] p...

2019-01-07 09:18:00 1464

转载 C# 获取系统时间及时间格式

--DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 取当前年月日时分秒      currentTime=System.DateTime.Now; 取当前年     int 年=currentTime.Year; 取当前月     int 月=currentTime.Month; 取当前日     int 日...

2019-01-04 19:38:56 300

原创 Unity 下拉框

首先在UI里添加组件Dropdownpublic class Test : MonoBehaviour {    private Dropdown dropdown;    private void Start()    {        dropdown = GetComponent<Dropdown>();    }    public void Show() {...

2018-12-28 15:15:59 1042

原创 C#单例模式的几种实现方式

一、多线程不安全方式实现 public sealed class SingleInstance { private static SingleInstance instance; private SingleInstance() { } public static SingleInstance Instance { ...

2018-12-21 10:38:13 634

原创 C#跳出循环break,continue,go to,return的关键字

break是循环结束执行,执行循环体后面的代码。continue是跳过本次循环未执行的代码,继续执行下一次循环。goto是跳到指定的指令去,你指哪,他跳到哪。 test1://标签1            for (int i = 0; i < 10; i++)            {test2://标签2                for (int j = 0; j...

2018-12-21 10:31:12 3839

原创 C#测程序运行时间

System.Diagnostics.Stopwatch Runtime = new System.Diagnostics.Stopwatch();        public Form1()        {            InitializeComponent();        } private void button1_Click(object sender, Eve...

2018-12-21 10:23:40 179

原创 C#获取数据库select某一列的值

首先SqlConnection需要引入的命名空间为System.Data.SqlClientpublic static void OpenDateBase() { List<int> idList = new List<int>(); // 数据库连接字符串,database设置为自己的数据库名,以Windows身份验...

2018-12-13 11:30:01 10889 4

原创 C#连接SQL Server 数据库

首先SqlConnection需要引入的命名空间为System.Data.SqlClient                    string connsql = "server=IP,端口;database=数据库名;uid=sa;pwd=pwd";//  "data source=IP;initial catalog=数据库名;user id=sa;pwd=pwd;pooling...

2018-12-13 09:26:21 744

原创 C# 启动带有参数的EXE文件

 public static  bool StartProcess(string filename, string[] args)        {            try            {                string s = "";                foreach (string arg in args)                {...

2018-12-12 14:44:58 903

原创 C#获得windows任务栏窗口句柄及一些操作(放大、缩小、关闭、隐藏……)

需调用API函数需在开头引入命名空间using System.Runtime.InteropServices;1、通过窗口名字查找[DllImport("user32.dll", EntryPoint = "FindWindow")]public static extern IntPtr FindWindow(string lp1, string lp2);示例:IntPtr...

2018-12-12 14:36:36 3107

原创 C#获取文件夹下的子文件夹

 public static List <string> getDirectory(string path)        {            List<String> list = new List<string>();            DirectoryInfo root = new DirectoryInfo(path);       ...

2018-12-05 12:04:16 5059

原创 C#判断获取的是文件夹还是文件

if(File.Exists(path)){// 是文件}else if(Directory.Exists(path)){// 是文件夹}else{// 都不是}

2018-12-04 22:40:36 4232 1

原创 C#把一个文件夹的复制到另一个文件夹当中

 public static  class Test    {        public static void CopyDir(string srcPath, string aimPath)        {            try            {                // 检查目标目录是否以目录分割字符结束如果不是则添加                ...

2018-12-04 21:55:24 1822

原创 C#遍历文件夹下子文件

 public  class ChooseMove    {        //遍历文件夹        public List<string> FindFile2(string path)        {            List<String> list = new List<string>();            //遍历文件夹...

2018-12-04 19:17:20 751

原创 windorm选择文件夹

string _path;        private void btnChoose_Click(object sender, EventArgs e)        {                   //选择文件夹            FolderBrowserDialog path = new FolderBrowserDialog();            path.S...

2018-12-04 18:07:33 107

原创 unity资源导入preview报错

“BCE0004: Ambiguous reference ‘preview‘: CameraMotionBlurEditor.preview, UnityEditor.Editor.preview.”只需要把preview替换为preview_即可var preview_ : SerializedProperty;preview_ = serObj.FindProperty ("pre...

2018-11-12 23:01:19 405

原创 C#繁体简体互转

  //繁体字转简体字        public static string ToSimplifiedChinese(string strTraditional)        {            string strSimple = Microsoft.VisualBasic.Strings.StrConv(strTraditional, Microsoft.VisualBasic...

2018-10-18 15:25:10 771

原创 C#写入或生成新的TXT文件中

 public void CreatTxt()        {           string str=" ";            if (!File.Exists("C:\\Users\\Administrator\\Desktop\\快点我.txt"))            {                StreamWriter strmsave = new Stre...

2018-10-18 14:56:48 3566

原创 C#读取TXT文件

public void ReadTxt(string path)        {            StreamReader sr = new StreamReader(path, Encoding.Default);            String line;            while ((line = sr.ReadLine()) != null)        ...

2018-10-18 14:47:59 5046 2

原创 C#去除list中的重复数据

public void CompareList()        {            for (int i = 0; i < nickNameList.Count; i++)            {                for (int j = nickNameList.Count-1; j>i ; j--)                {       ...

2018-10-18 14:46:08 2852

原创 C#只保留字符串数字和汉字(不包括拼音打出来的)

public static List<string> CharacterRemoval()        {               for (int i = 0; i < nickNameList.Count; i++)            {                if (Regex.IsMatch(nickNameList[i], "[A-Za-z0-...

2018-10-18 14:44:17 2565

原创 接口实例化

class Program{ static void Main(string[] args) { //C#中COM接口是可以实例化的,但其实这种写法是使接口“映射”到某一个类上,实际上创建的是这个类的实例。 IinterfaceTest test = new IinterfaceTest(); }}[ComImport, CoClas...

2018-09-07 10:15:30 180

原创 unity笔记Json与对象之间的转化

首先导入LitJson类库,编写脚本的时候需要引入using LitJson类库,然后进行操作;1. 把对象转化成 JSON格式字符串: JsonMapper.ToJson2. 把JSON格式字符串转化成对象: JsonMapper.ToObject下面是我自己写的一些简单代码:public class Person{    public string Name { get; s...

2017-10-18 17:04:15 1320

空空如也

空空如也

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

TA关注的人

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