摘要: 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)