摘要: 一个简单的用来清空或则删除数组尾部元素的简单方法就是改变数组的length属性值 const arr = [11, 22, 33, 44, 55, 66]; // truncanting arr.length = 3; console.log(arr); //=> [11, 22, 33] // c 阅读全文
posted @ 2021-07-23 23:32 ♩♪♫♬ 阅读(237) 评论(0) 推荐(0)
摘要: var person = {name :'Saad', age : 26, department : {ID : 15, name : "R&D"} }; var stringFromPerson = JSON.stringify(person); /* stringFromPerson 结果为 " 阅读全文
posted @ 2021-07-23 23:23 ♩♪♫♬ 阅读(50) 评论(0) 推荐(0)
摘要: 1、使用NUnit建立自动单元测试(集成在VS2010 中了); 2、FXCop工具会获取程序集中的IL代码,并将其与异族编码规则和最佳实践对照分析,最后报告违例情况; 3、ILDasm是一个IL反汇编工具,可以帮助我们洞察细节; 4、Shared Source CLI是一个包含.NET框架内核和C 阅读全文
posted @ 2021-07-23 22:58 ♩♪♫♬ 阅读(77) 评论(0) 推荐(0)
摘要: 较正规的编程风格  在一个二元操作符的每一边都加一个空格  在每一个逗号后面而不是前面加一个空格  每一个关键字后面加一个空格  一行一个语句  分号前不要有空格  函数的园括号和参数之间不加空格  在一元操作符和操作数之间不加空格 在一个二元操作符的每一边都加一个空格: Consol 阅读全文
posted @ 2021-07-23 22:20 ♩♪♫♬ 阅读(51) 评论(0) 推荐(0)
摘要: // Stack名字空间namespace Stack{ using System; public class Stack { // first: 栈最上面一个节点 private Node first = null; // count: 栈中节点的数量 private int count = 0; 阅读全文
posted @ 2021-07-23 22:14 ♩♪♫♬ 阅读(141) 评论(0) 推荐(0)
摘要: using System; class Rectangle{ private int iHeight; private int iWidth; // 缺省构造函数 public Rectangle() { Height=0; Width=0; } // 构造函数重载 public Rectangle 阅读全文
posted @ 2021-07-23 22:12 ♩♪♫♬ 阅读(76) 评论(0) 推荐(0)
摘要: using System; class MyClass{ public static void Main() { int varA = 10; //二进制为 00001010 int varB = 20; //二进制为 00010100 // “与”运算 int andResult = varA & 阅读全文
posted @ 2021-07-23 21:59 ♩♪♫♬ 阅读(158) 评论(0) 推荐(0)
摘要: // 声明一个枚举类型Weekday,基类为int,访问范围为public public enum Weekday { Sun, Mon, Tue, Wed, Thu, Fri, Sat } // 功能: 得到某日的下一日(星期几) // 参数: // wd : 枚举类型Weekday // 返回值 阅读全文
posted @ 2021-07-23 21:56 ♩♪♫♬ 阅读(126) 评论(0) 推荐(0)
摘要: using System;using System.Collections; class ForeachApp{ public static void Main() { // 把环境变量中所有的值取出来,放到变量environment中 IDictionary environment = Envir 阅读全文
posted @ 2021-07-23 21:51 ♩♪♫♬ 阅读(62) 评论(0) 推荐(0)
摘要: using System; class ForApp { public static void Main() { //打印表头 Console.WriteLine("九九乘法表"); //打印九九表 for(int i = 1; i <= 9; i++) { //计算并格式化输出九九表的内容 for 阅读全文
posted @ 2021-07-23 21:48 ♩♪♫♬ 阅读(95) 评论(0) 推荐(0)
摘要: using System; using System.IO; public class FileApp { public static void Main() { // 在当前目录创建一个文件myfile.txt,对该文件具有读写权限 FileStream fsMyfile = new FileSt 阅读全文
posted @ 2021-07-23 21:43 ♩♪♫♬ 阅读(179) 评论(0) 推荐(0)
摘要: using System;using System.Diagnostics;class close_special_exe{ static void Main() { Process[] myProcess; myProcess=Process.GetProcessesByName ("Notepa 阅读全文
posted @ 2021-07-23 21:41 ♩♪♫♬ 阅读(48) 评论(0) 推荐(0)
摘要: using System;namespace _02_26{ class Class_02_26 { public static void Main() { string sTemp; int iNum=new Random ().Next ()%100; //int i_random=new Ra 阅读全文
posted @ 2021-07-23 21:32 ♩♪♫♬ 阅读(1017) 评论(0) 推荐(0)
摘要: using System;class ChooseSubject{ static void Main() { int i; string str; Console.WriteLine ("Please choose your favorite subjects:-1 is quit."); Cons 阅读全文
posted @ 2021-07-23 21:30 ♩♪♫♬ 阅读(441) 评论(0) 推荐(0)
摘要: 字串变量.Replace("子字串","替换为") 字串替换 如: string str="中国"; str=str.Replace("国","央"); //将国字换为央字 Response.Write(str); //输出结果为“中央” 再如:(这个非常实用) string str="这是<scr 阅读全文
posted @ 2021-07-23 21:27 ♩♪♫♬ 阅读(72) 评论(0) 推荐(0)
摘要: 1.char.IsWhiteSpce(字串变量,位数)——逻辑型 查指定位置是否空字符; 如: string str="中国 人民"; Response.Write(char.IsWhiteSpace(str,2)); //结果为:True, 第一个字符是0位,2是第三个字符。 2.char.IsP 阅读全文
posted @ 2021-07-23 21:23 ♩♪♫♬ 阅读(117) 评论(0) 推荐(0)
摘要: 1. Session["变量"]; 存取Session值; 如,赋值: Session["username"]="小布什"; 取值: Object objName=Session["username"]; String strName=objName.ToString(); 清空: Session. 阅读全文
posted @ 2021-07-23 21:19 ♩♪♫♬ 阅读(107) 评论(0) 推荐(0)
摘要: 1.String user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString(); 取远程用户IP地址 2.//穿过代理服务器取远程用户真实IP地址: if(Request.ServerVariables["HTTP_VIA"]!=null){ s 阅读全文
posted @ 2021-07-23 21:15 ♩♪♫♬ 阅读(94) 评论(0) 推荐(0)
摘要: 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 阅读全文
posted @ 2021-07-23 21:09 ♩♪♫♬ 阅读(467) 评论(0) 推荐(0)
摘要: xxx try { ...xxx; } catch(Exception ex) { } 阅读全文
posted @ 2021-07-23 00:02 ♩♪♫♬ 阅读(43) 评论(0) 推荐(0)