随笔分类 - C#学习
摘要:1 // clrTest1.cpp: 主项目文件。 2 3 #include "stdafx.h" 4 5 using namespace System; 6 using namespace System::Data; 7 8 int main(array ^args) 9 {10 DataTable^ dtable = gcnew DataTable("myTable");11 DataColumn^ column;12 //col 113 column = gcnew DataColumn("begin_time",System:
阅读全文
摘要:初始5个Nodes隐藏23节点,打印全部节点Tag显示23,打印全部节点Tag隐藏全部节点,打印节点TagTreeList.Nodes.Count == TreeList.AllNodesCount;知道这些后,可以通过隐藏节点,不必显示;而保存TreeList所有tag时,还是可以通过TreeList.Nodes[i]来保存隐藏节点的Tag值;注意的是,隐藏时:TreeList.Nodes[i].Visible =false ;TreeList.Nodes[i].Tag.parent = nullptr;TreeList.Ndoes[i].Tag.Visible =false ;不同的是,删
阅读全文
摘要:Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName;例如结果为: C:\Documents and Settings\tll\Local Settings\Application Data\Temporary Projects\urlForm\bin\Debug\urlForm.exe
阅读全文
摘要:正则表达式通常包含字母文本(Literaltext)和元字符(metacharacter)字母文本指的是普通文本如"abcde"可匹配字符串中任何包含"abcde"的字符串。元字符则更加灵活运用通用的表达式匹配所有符合此表达式规律的字符串。C#正则表达式语法一、匹配单个字符 []——从中选择一个字符匹配中间支持的类型:单词字符([ae])、非单词字符([!?,;@#$*])、字母范围([A-Z])、数字范围([0])eg.正则表达式[ae]ffect可匹配字符串 affect,effect(此例中"[ae]"为元字符,"ff
阅读全文
摘要:double GetDirectoryLength(string dirPath) //获取文件大小 { double len = 0; //判断给定的路径是否存在,如果不存在则退出 if (!Directory.Exists(dirPath)) return len; //定义一个DirectoryInfo对象 DirectoryInfo di = new DirectoryInfo(dirPath); //通过GetFiles方法,获取di目录中的所有文件的大小 foreach (FileInfo fi in di.GetFiles()) len += fi.Length; //获取di中
阅读全文

浙公网安备 33010602011771号