C#
C#
CupidoZ
上帝不掷色子,上帝的上帝也不掷色子,这不会影响我们一直认为一切高维度都在掷色子
-------CupidoZ
展开
-
Serialize序列化和Unserialize反序列化
序列化的理解:序列化 (Serialization)是将对象的状态信息转换为可以存储或传输的形式的过程。在序列化期间,对象将其当前状态写入到临时或持久性存储区。以后,可以通过从存储区中读取或反序列化对象的状态,重新创建该对象。序列化使其他代码可以查看或修改那些不序列化便无法访问的对象实例数据。确切地说,代码执行序列化需要特殊的权限:即指定了 SerializationFormatter 标志的 SecurityPermission。在默认策略下,通过 Internet 下载的代码或 Internet .原创 2022-05-24 22:01:41 · 459 阅读 · 1 评论 -
C#DO...WHILE循环
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明一个变量a 初始值为0 int a = 0; //do...while循环 do...先执行完毕 进入while判断 成立继续跳回do....执行 //当再次判断不满足条件原创 2022-05-21 01:17:05 · 419 阅读 · 0 评论 -
C# FOR循环
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明一个变量a 初始值为0 int a = 0; //循环100次 打印出0--100间数字的总和 for (int i = 0; i <= 100; i++)原创 2022-05-21 01:03:29 · 167 阅读 · 0 评论 -
C# SWITCH分支判断
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个简单整数变量a,b int a = 1; //switch判断一下a的值符合那种情况 符合的话就会在相应分支break处跳出整个循环 //并且结束循环的原创 2022-05-21 00:57:50 · 378 阅读 · 0 评论 -
C#While循环
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个简单整数变量a,b int a = 1; int b = 3; while (a>b) { Console.Write原创 2022-05-21 00:47:38 · 323 阅读 · 0 评论 -
C# IF判断
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个简单整数变量a,b int a = 1; int b = 3; //if判断的成立条件放在(....)中 //如果不成立则继续进行else条件判断原创 2022-05-21 00:42:06 · 534 阅读 · 0 评论 -
C#关系运算
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个简单整数变量a,b int a = 1; int b = 3; //输出a,b关系运算结果 Console.WriteLine(a > b);原创 2022-05-21 00:27:55 · 121 阅读 · 0 评论 -
C#逻辑运算
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明三个布尔变量 真 假 真 bool a = true; bool b = false; bool c = true; //输出或且非逻辑原创 2022-05-21 00:21:54 · 378 阅读 · 0 评论 -
C#的类型转换
using System;namespace demo_01{ class Program { static void Main(string[] args) { int a = 1; double b = 1.3; //使用转换工具类转换也会一定的精度 int c = Convert.ToInt32(b);原创 2022-05-21 00:12:52 · 62 阅读 · 0 评论 -
C#自增自减运算
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个变量 int num1 = 2; int num2 = 2; //后自增运算结果 int res1 = num1--;原创 2022-05-20 23:53:49 · 391 阅读 · 0 评论 -
C#取模运算
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个变量 int num1 = 4; int num2 = 2; int num3 = 3; //进行取模运算 int re原创 2022-05-20 23:38:25 · 4297 阅读 · 0 评论 -
C#的基础运算
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明两个变量 int num1 = 100; int num2 = 200; //加减乘除四则运算 int plus = num1 + num2;原创 2022-05-20 23:29:38 · 181 阅读 · 0 评论 -
C# 的赋值操作
using System;namespace demo_01{ class Program { static void Main(string[] args) { //声明局部变量 并且赋值200 int num2 = 200; //输出局部变量num2 Console.WriteLine(num2);原创 2022-05-20 23:21:21 · 2356 阅读 · 0 评论 -
C#成员变量和局部变量的声明
using System;namespace demo_01{ class Program { //成员变量的声明 private static int num1 =100; static void Main(string[] args) { //声明局部变量 int num2 = 200; //打印C#成员变量 Conso原创 2022-05-20 23:13:25 · 443 阅读 · 0 评论 -
C# 输出语句示例
using System;namespace demo_01{ class Program { static void Main(string[] args) { //输出语句println() Console.WriteLine("你好,第一个C# cli程序"); //使用阻塞io暂停cmd窗口消失 Console.ReadLine();原创 2022-05-20 23:06:04 · 3133 阅读 · 0 评论 -
VS安装插件失败解决方法
解决方法1解决方法2个人学习用途博客 部分内容摘抄自网络原创 2022-01-16 17:20:08 · 2511 阅读 · 2 评论 -
C# 调用可执行exe文件
利用进程池方式启动string exefile = "xxx.exe";if (File.Exists(exefile)) { Process process = new Process(); // params 为 string 类型的参数,多个参数以空格分隔,如果某个参数为空,可以传入”” ProcessStartInfo startInfo = new ProcessStartInfo(exefile, params); process.StartInfo = star原创 2021-12-31 00:31:21 · 6497 阅读 · 0 评论 -
C#d调用外部bat
引入名称空间:using System.Diagnostics; Process proc = null;try{string targetDir = string.Format(@"D:\BATFile\");//this is where testChange.bat liesproc = new Process();proc.StartInfo.WorkingDirectory = targetDir;proc.StartInfo.FileName = "Video.bat";原创 2021-12-15 17:58:51 · 333 阅读 · 0 评论 -
C#位运算补充
个人学习用途博客 部分内容摘抄自网络原创 2021-11-18 15:40:08 · 126 阅读 · 0 评论 -
C#位运算
个人学习用途博客 部分内容摘抄自网络原创 2021-11-18 15:37:59 · 214 阅读 · 0 评论 -
C# socket的基本理解
博客园中看到的比较准确的socket理解个人学习用途博客 部分内容摘抄自网络原创 2021-10-25 15:59:13 · 1037 阅读 · 0 评论 -
C# 很标准的socket串口通讯实现方式
一个很标准的socket串口通讯实现方式个人学习用途博客 部分内容摘抄自网络原创 2021-10-25 15:54:35 · 615 阅读 · 0 评论 -
C# 常用ORM框架
个人学习用途博客 部分内容摘抄自网络原创 2021-10-21 16:51:28 · 4407 阅读 · 0 评论 -
C# nuget发布类库方式
个人学习用途博客,部分内容摘抄自网络原创 2021-10-18 16:51:04 · 1408 阅读 · 0 评论 -
VS扩展安装卡住解决方法
一、背景小伙伴们在安装visual studio,或者更新,扩展vs功能时,在家里网速正常的情况下,可能出现进度十分缓慢的问题,如何解决呢?二、解决思路修改hosts文件1.地址:默认安装在 C:\windows\system32\drivers\etc2.用记事本或者其他编辑工具打开hosts,在最后一行加上110.53.72.104 download.visualstudio.microsoft.com13.然后运行cmd,执行以下命令,刷新dnsipconfig /flushdns原创 2021-10-16 16:04:49 · 6079 阅读 · 0 评论 -
C#CommandBehavior的作用
CommandBehavior.CloseConnection有何作用其用在ExecuteReader(c)中,返回对象前不能关闭数据库连接,须用CommandBehavior.CloseConnection;这是一个关于实际知识点的问题,面试官考查的是应聘者数据库访问的编程经验。本节将针对这个问题展开具体的分析。对于此类关于具体知识点的问题,读者在平时应该注意积累,这样在面试中才能从容应答。所涉及的知识点CommandBehavior.CloseConnection的使用分析问题由于原创 2021-10-14 20:32:05 · 854 阅读 · 0 评论 -
C#基本语法结构
语言基本语法结构//命名空间的引用using System;//当前命名空间的命名namespace HelloWorldApplication{ /* 类名为 HelloWorld */ class HelloWorld { /* main函数 */ static void Main(string[] args) { /* 方法体 */ Console.WriteLine("原创 2021-10-10 14:26:44 · 14522 阅读 · 0 评论