摘要: 1.可存在同名对象 class A: def __init__(self): print('this is class.') def A(): print('this is method.') a = A() # this is method. 由于python是边编译边执行的语言,所以只会使用最近 阅读全文
posted @ 2022-10-14 17:07 Bridgebug 阅读(170) 评论(0) 推荐(0)
摘要: 一、创建类 class People: pass p = People() 二、构造函数 __init__()方法是一种特殊的方法,被称为类的构造函数或初始化方法,当创建了这个类的实例时就会调用该方法。 python中一个类只能有一个构造函数,即只能有一个 __init__ 方法(有多个时,最后一个 阅读全文
posted @ 2022-10-14 16:52 Bridgebug 阅读(99) 评论(0) 推荐(0)
摘要: 由于个人不喜欢定义那么多变量,而在wpf的vm中需触发更新的变量都要定义一个字段和属性。 例如: private string _name; public string Name { get { return _name; } set { _name = value; RaisePropertyCh 阅读全文
posted @ 2022-09-13 11:38 Bridgebug 阅读(110) 评论(0) 推荐(0)
摘要: 通常情况下,是将C#代码共享到python脚本中,可以通过脚本调用C#的各个对象。 一、IronPythonRunner 创建IronPython运行器,可通过该运行器运行python脚本。 using System; using System.Collections.Generic; using 阅读全文
posted @ 2022-08-24 15:09 Bridgebug 阅读(357) 评论(0) 推荐(0)
摘要: 假如有脚本 test1.py def get(): return 'this is test1' 在脚本 test2.py 中调用 test1.py 的 get 方法 1.用全名访问 import test1 print(test1.get()) 2.用别名访问 import test1 as t1 阅读全文
posted @ 2022-07-28 15:31 Bridgebug 阅读(142) 评论(0) 推荐(0)
摘要: 创建SyncingClass类,继承与ContextBoundObject,并标记Synchronization特性; 需实现上下文同步的实例必须继承ContextBoundObject和标记Synchronization特性; using System; using System.Threadin 阅读全文
posted @ 2022-06-22 10:32 Bridgebug 阅读(185) 评论(0) 推荐(0)
摘要: FOR FOR %%variable IN (set) DO command [command-parameters] %variable 指定一个单一字母可替换的参数。 (set) 指定一个或一组文件。可以使用通配符。 command 指定对每个文件执行的命令。 command-parameter 阅读全文
posted @ 2022-04-16 01:16 Bridgebug 阅读(697) 评论(0) 推荐(0)
摘要: 批处理是一种简化的脚本语言,也称作宏。它应用于DOS和Windows系统中,它是由DOS或者Windows系统内嵌的命令解释器(通常是COMMAND. COM或者CMD.EXE)解释运行。类似于Unix中的Shell脚本。批处理文件具有.bat或者.cmd的扩展名。批处理语法中是不区分大小写。 RE 阅读全文
posted @ 2022-04-13 22:17 Bridgebug 阅读(278) 评论(0) 推荐(0)
摘要: 一、Thread (System.Threading) 1.前台线程和后台线程 只要有一个前台线程在运行,应用程序的进程就在运行,直到所有前台线程完成其任务为止。在默认情况下,用 Thread类创建的线程是前台线程。线程池中的线程总是后台线程。在用 Thread类创建线程时,可以设置 IsBackg 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(401) 评论(0) 推荐(0)
摘要: Enumerable.Range(0, 20).Select(i => { long x = 1; for (int j = 1; j <= i; j++) { x *= j; } Console.WriteLine(i + "计算完成"); return x; }); 当你尝试运行上面的代码,会发 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(959) 评论(0) 推荐(0)
摘要: 一、XML的序列化 using System.Xml.Serialization; https://www.cnblogs.com/KeithWang/archive/2012/02/22/2363443.html 1.建立序列化测试对象 [XmlRootAttribute("City", Name 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(220) 评论(0) 推荐(0)
摘要: 1.个人类Person public class Person { public Person(string fName, string lName) { this.FirstName = fName; this.LastName = lName; } public string FirstName 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(362) 评论(0) 推荐(0)
摘要: using System.Collections.Generic; using System.Configuration; //有可能可以using但不能用,需重新添加引用 /// <summary> /// 针对配置文件的读写操作 (App.config) /// ps:key和name都不区分大 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(699) 评论(0) 推荐(0)
摘要: 前言 什么是NuGet? NuGet是.NET的软件包管理器。NuGet客户端工具提供了生成和使用软件包的功能。NuGet Gallery是所有软件包作者和使用者都使用的中央软件包存储库。 包的安装和卸载 (以Newtonsoft.Json举例) 1.控制台 安装:Install-Package N 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(472) 评论(0) 推荐(0)
摘要: 前言:摘抄至 Sql server从入门到精通 密码:yskt 一、事务的概念 事务是由一系列语句构成的逻辑工作单元。事务和存储过程等批处理有一定程度上的相似之处,通常都是为了完成一定业务逻辑而将一条或者多条语句“封装”起来,使它们与其他语句之间出现个逻辑上的边界,并形成相对独立的一个工作单元。 当 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(474) 评论(0) 推荐(0)
摘要: 几个基本类型都有TryParse方法,将object 自动识别类型和转换 using System.Reflection; public static bool TryParse<T>(object val, out T t) { t = default(T); if (val == null) { 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(226) 评论(0) 推荐(0)
摘要: 一、窗体 绿色边框框住的区域:屏幕橙色边框框住的区域:窗体黄色边框框住的区域:窗体工作区 1.边框 窗体的FormBorderStyle可以设置以下的值,每个值导致窗体的边框的宽度不一样,但是可以发现的是左、右、下边框的宽度是一样的: // // 摘要: // 指定窗体的边框样式。 [ComVisi 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(2569) 评论(0) 推荐(2)
摘要: using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; namespace WindowsFo 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(531) 评论(0) 推荐(0)
摘要: 一、数据模型 Database First (数据库优先):先创建数据库表,然后自动生成EDM文件,EDM文件生成模型类 Model First (模型优先):先创建Edm文件,Edm文件自动生成模型类和数据库;Code First(代码优先):自己写模型类,然后生成数据库,没有EDM。 这里我们现 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(170) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using Spire.Pdf; using Spire.Pdf.AutomaticFields; usin 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(743) 评论(0) 推荐(0)
摘要: using System; using System.ComponentModel; using System.Reflection; namespace PropertyGridUse { public class PropertyAttribute<T> { /// <summary> /// 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(717) 评论(1) 推荐(0)
摘要: 1、效果图 2、导入导出 using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using System.Windows.Forms; 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(1686) 评论(0) 推荐(0)
摘要: 一、比特币 比特币(Bitcoin)的概念最初由中本聪在2008年11月1日提出,并于2009年1月3日正式诞生 。根据中本聪的思路设计发布的开源软件以及建构其上的P2P网络。比特币是一种P2P形式的虚拟的加密数字货币。点对点的传输意味着一个去中心化的支付系统。 与所有的货币不同,比特币不依靠特定货 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(773) 评论(0) 推荐(0)
摘要: 摘要: C#中的自定义控件中的属性(Property)、事件(Event)及一些相关特性(Attribute)的总结 今天学习了下C#用户控件开发添加自定义属性的事件,主要参考了MSDN,总结并实验了一些用于开发自定义属性和事件的特性(Attribute)。 在这里先说一下我的环境: 操作系统:Wi 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(1615) 评论(0) 推荐(0)
摘要: exec('select * from [Table] where [Name]= ''GG'''); 注意:这里GG是以两个单引号括起来的,不是双引号 阅读全文
posted @ 2022-04-12 22:46 Bridgebug 阅读(244) 评论(0) 推荐(0)