随笔分类 -  ASP.net

调用传递的参数
摘要:C#方法调用传递的参数分四类: 默认的值参数(value parameter); //传递复制品 引用参数(reference parameter),关键字 "ref ";//传递引用指针 输出参数(output parameter),关键字 "out "。//方法返回一个以上的返回值时使用 数组参数(array parameter),关键字 "params " ===================================其实不用想的太复杂,简单点想引用参数,ref,比如 public int Fun(ref int k);这样的函数,你想在函数体内修改参数k的值, 阅读全文

posted @ 2011-02-07 10:36 i617 阅读(212) 评论(0) 推荐(0)

变量的作用域(3)
摘要:namespace ConsoleApplication3{ class Program { static string mystring; static void write() { string mystring = "string defined in wrtie()"; Console.WriteLine("now in write()"); Console.WriteLine("Local mystring={0}", mystring); Console.WriteLine("Global mystring={0}",Program.mystring ); } static voi 阅读全文

posted @ 2011-01-24 19:10 i617 阅读(153) 评论(0) 推荐(0)

通过函数交换数据(1)
摘要:namespace ConsoleApplication2{ class Program { static int MaxValue(int[] intArray) { int maxVal = intArray[0]; for (int i = 1; i intArray.Length; i++) { if(intArray [i]maxVal) maxVal=intArray [i]; } return maxVal; } static void Main(string[] args) { int[] myArray = {1,3,8,9,5,6,0,2 }; int maxVal 阅读全文

posted @ 2011-01-22 15:24 i617 阅读(174) 评论(0) 推荐(0)

枚举
摘要:namespace ConsoleApplication2{ enum orientation : byte { north=1, south=2, east=3, west=4 } class Program { static void Main(string[] args) { byte directionByte; string directionString; orientation myDirection = orientation.north; Console.WriteLine("myDirection={0}", myDirection); directionByte = (b 阅读全文

posted @ 2011-01-20 08:16 i617 阅读(482) 评论(0) 推荐(0)

什么是[构造函数]
摘要:class Renlei //添加一个"人类"的 类{ public int Shengao; //声明一个 身高 的 整型变量 public Renlei() //这个方法叫 构造函数(方法名 和 类名 同名的就叫构造函数)--好处是:程序一加载就要运行一次 { Console.WriteLine("出生时的哭声Wawawa..."); } ~Renlei() //这个方法叫 析构函数(特点:和类同名,前面加一个"~")--好处是:刚把人造出来就干掉了,好惨忍...呜呜 { Console.WriteLine("俺不想死呀"); } public void Shuohua 阅读全文

posted @ 2011-01-06 16:38 i617 阅读(358) 评论(0) 推荐(0)

从0学asp.net笔记之一:字符串
摘要:边学边记边练边问,老师就在旁边 阅读全文

posted @ 2011-01-06 00:24 i617 阅读(146) 评论(0) 推荐(0)

aps.net的内置对象
摘要:response:向客户端输出信息  Response.Write("ddd");  Response.Redirect("http://www.baidu.com");Request 对象当浏览器向服务器请求页面时,这个行为就被称为一个 request(请求)。ASP Request 对象用于从用户那里获取信息。它的集合、属性和方法描述如下:集合描述ClientCertificate包含了存储于客户证书中的域值(field values)Cookies包含了 HTTP 请求中发送的所有 cookie 值Form包含了使用 post 方法由表单发送的所有的表单(输入)值QueryString包 阅读全文

posted @ 2011-01-01 08:08 i617 阅读(269) 评论(0) 推荐(0)

导航