- 博客(23)
- 问答 (1)
- 收藏
- 关注
原创 XAML 布局StackPanel
<Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Mai
2014-04-30 09:24:26 2207
原创 WPF控件
Control:控件content:内容Method:方法Property:属性ReadOnly:只读 IsReadOnly:取值 boolVisiblility:控件是否可见 visible:可见 Collapsed:不可见IsEnabled:控件是否可用, 取值为true:falseBackground:背
2014-04-29 20:50:37 1282
转载 WPF中的事件列
WPF中的事件列表ListBoxItem.Selected 选取 ListBoxItem 时发生。ListBoxItem.Unselected 取消 ListBoxItem 选取时发生。MediaElement.BufferingEnded 结束媒体缓冲处理时发生。MediaElement.BufferingStarted 已开始媒体缓冲处理时发生。MediaElement.Media
2014-04-29 13:57:46 3242
原创 Linq To Entity 多表联合查询
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace LinqToEntity{ class Program { static void Main(string[] args) { //
2014-04-28 16:19:18 3456
原创 为datatable增加自增列
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;namespace dataTable自增列{ class DataTableID { /// /// 为dt表增加一个自增的ID字段
2014-04-26 09:35:35 4036
原创 向一个数组随机插入一个1~100的数。
namespace ConsoleApplication2{ class Program { static void Main(string[] args) { List list = new List(); Random ran = new Random();
2014-04-25 16:41:37 2584
原创 c#MD5加密TripleDES加密解密封装
public static string EncMd5(string str) { //获取加密服务 System.Security.Cryptography.MD5CryptoServiceProvider md5CSP = new System.Security.Cryptography.MD5CryptoServiceProvider(); //获取要加密的字段,并转化为Byte[]数组
2014-04-25 14:50:50 2018
原创 c#字符串加密与解密封装
//将用户传进来的字符串转换成编码为UTF8的二进制流 byte[] encStrStream = Encoding.UTF8.GetBytes(encStr); //建立一个MemoryStream,这里面存放加密后的数据流 MemoryStream mStream = new MemoryStream();
2014-04-24 16:37:54 1879
原创 C#字符串的加密与解密(DES和TripleDES算法的加密解密过程)
//获取已经加密的数据流 byte[] getStream = Encryption_Decryption.EncryptString(strArray, keyArray, IVArray); //获取已经解密的数据流 byte[] finalPlainTextArray = Encryption_Decryption.DecryptTextFromMemory(getStream, keyArray, IVArray);
2014-04-24 14:23:11 3604 1
原创 Ref_Out
//out应用场景是内部为外部变量赋值,所以不需要先初始化(赋值),只要在函数里面为参数赋值 //out一般用在函数有多个返回值的场所【一个函数(方法)只能有一个返回值,如果想要有多个返回值就用out】 class Out { public static void IncAge(int age) { age++; } //out内部 public static void IncA
2014-04-23 23:18:52 1106
原创 数组赋值
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace 类对象赋初值,数组赋初值的区别{ class Student { public string Name { get; s
2014-04-23 12:17:01 1015
原创 Linq与where实现查询(Linq to Entity)【IEnumerable与IEnumerator与IList】|自己实现foreach的功能
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace linq{ class Student { public string Name { get; set; }
2014-04-23 10:49:18 1966
转载 -----------------委托的使用场合 (使用方式)----------------
字段名称字段类型字段说明取值说明code整型操作状态码0:成功tip文本出错信息说明为空doctorArrangesJSONArray对象医生排班信息 doctorArrang
2014-04-19 11:22:42 1346
原创 Typeof()与 GetType() ,获取对象的所有公有属性和所有公有方法GetProperties()GetMethods()
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace StringBuilders{ class TabName { public TabName() {
2014-04-16 14:41:42 3662
原创 StringBuilder底层原理
string 与stringbuilder的区别,String对象是不可以改变的,每次使用String.String类中的方法时都要在内存中创建一个新的字符串对象,就需要为该新的对象分配新的空间而stringbuilder对象是动态对象,它允许扩充它所封装的字符串中字符的数量,但是您也可以为它容量可以容纳最大字符数指定一个值。当修改StringBuilder时,在达到容量之前,它是不会为其自...
2014-04-16 11:34:05 3076 1
原创 将DataSet转换成List
将一个dataSet转换成一个list所以就需要取得DataSet里面的一个table表因为list是IList<T>类型的,所以就要实例化一个list 【IList<T> list=new List<T>】这时候我就要取得T类型的所有公有成员,来接收table表的字段【PropertyInfo[] tMembersAll = t.GetType().GetProperties();】然后我在遍历一下这些所有的公有成员取得其中的一个成员【foreach (PropertyInfo tMember i
2014-04-11 17:38:51 14011 1
原创 C# 集合与数组的区别 | C# 操作2个List进行比较
int[] ar = new int[3]; ar[0] = 1;//优点很明显,根据下标随机访问 ar[1] = 2;//缺点也很明显,比如容量是固定的 ar[2] = 3;//又或者访问的时候下标越界了…… //ar[3] = 4;想多点就干瞪眼了 List list = ne
2014-04-10 09:40:41 2763
原创 DataSet与IList<>之间的转换
using System.Data;using System.Collections;using System.Reflection;using System.Collections.Generic;using System;//DataSet与泛型集合间的互相转换 //利用反射机制将DataTable的字段与自定义类型的公开属性互相赋值。 //注意:从DataSet到ILi
2014-04-09 17:24:28 2481
原创 C#泛型 List<T>的本质 | List原理机制
首先我们来看看List<T>这个泛型类根据下面代码总结:当我们在创建一个List<T>类型对象的时候,如果没有给List<T>指定一个初始长度,那么也就是说,当我们执行0参数的构造方法时,微软为我们创建了一个T类型的个数为0的数组当我们调用Add方法时候,List会新建一个数组,然后把数组的长度设置为原来的二倍(如果原有的数组长度为0,那就默认将数组的长...
2014-04-09 14:07:41 3491
原创 泛型约束 | where T : class的含义
public static List ConvertIListtolist (IList gblist) where T : class这是参数类型约束,指定T必须是Class类型。
2014-04-09 11:24:21 7643
原创 属性
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace list{ public class User { int age; //起到一个存数据的作用。 public int Age //Age本身没
2014-04-08 22:59:10 1038
转载 判断空值String.IsNullOrEmpty()和String.IsNullOrWhiteSpace()
由于总用 String.IsNullOrEmpty( s ) ,就上网收了一下相关的资料,其实这种用法和s == null || s.Length == 0这种判断方法并无太大区别。只是在速度上可能后者比前者快那么一点点(百万毫秒级别上的),但是瑕不掩瑜,前者便于阅读代码。在对效率要求不高的时候,还是使用前者吧。.Net4.0又出现了String.IsNullOrWhiteSpace()这
2014-04-08 10:57:27 3459
Vue项目 Router路由,Pinia状态管理, Vuex状态管理 Vant List组件案例
2023-11-16
CSS选择器的问题:.class.class{}
2015-01-10
TA创建的收藏夹 TA关注的收藏夹
TA关注的人