Tuesday, March 03, 2009 by rain
What is meant by nonstop?In C (with C++ ) in,Oversight Break and press writing code below is completely lawful:
NVar = 1Switch (nVar)
{Case 1:
DoSomething();Case 2:
DoMore();
}
In this example,After the code that implemented statement of the first Case,the code that implements other Case label directly,Exit Switch language till statement of a Break paragraph till.Although sometimes this is a powerful function,But it more the flaw that often generation is hard to discover.
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
When use Foreach,Should note a problem only:When the type of affirmatory loop variable,Should careful all the more.Select wrong kind and was not compiled implement detect,But it can suffer when move detect,And can cause unusual.
Statement of 6.2.3 While
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
The seventh chapter? Unusual processing
When universal language moves (CLR) a when have very large dominant position is,Unusual processing is to cross what the language is standardized.Is what in C# place causes one unusually OK in Visual? Must manage everywhere in Basic client.Have no longer? HRESULTs? Or? ISupportErrorInfo? Interface.Although cross a language of unusual processing cover a range very wide,But this one chapter discusses C# completely centrally unusual processing.You are compiled for the change a bit implement behavior of excessive provenance manage,Then interesting thing began:You handled this unusual.Should add more shifts,What cause your place to found subsequently is unusual.
7.1? Desired result (Checked) and blame desired result (Unchecked) statement
When your executive operation,The effective range that can produce computation to exceed type of result variable data as a result likely.This kind of circumstance is called to spill over,According to different programming language,You will by inform with some kind of means -- perhaps was not informed at all.(C++ programmer sounds familiar?)
So,C# spills over like where manage?? Should find out its acquiesce behavior,The factorial case that sees me be mentioned in front of this book please.(to go to the lavatory its see,Is the example in front in again detailed list? 7.1? Give out in)
Detailed list? 7.1? What computation counts is factorial
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
The project that 1. starts Visual Studio.NET and opens you.
2. manages in " solution resource implement in " window,Right attack " to cite " folder,Add from " of the choice in playing menu giving form next cite " .
Show " is added namely cite " dialog box.
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
The person of process designing of database of begin to learn,Classics regular meeting is right " empty value " generation doubt,All data in a list that builds through process designing for example all show for,The hand is moved blank became again after add and deleting a written language;The field of type of a string,Did not write a value obviously,Do not be equal to "" however;Take a cost from inside the database with ADO.NET,Every encounter some to make mistake... this needs us to affirming a few kinds knowledge.NET and SQL Server are medium different " empty value " .
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
1. 引言
类型安全是.NET设计之初重点考虑的内容之一,对于程序设计者来说,完全把握系统数据的类型安全,经常是力不从心的问题。现在,这一切已经在微软大牛们的设计框架中为你解决了。在.NET中,一切类型都必须集成自 System.Object类型,因此我们可以很容易的获得对象的准确类型,方法是:GetType()方法。那么.NET中的类型转换,应该考虑的地方有那些呢?
2. 概念引入
类型转换包括显示转换和隐式转换,在.NET中类型转换的基本规则如下:
·任何类型都可以安全的转换为其基类类型,可以由隐式转换来完成;
·任何类型转换为其派生类型时,必须进行显示转换,转换的规则是:(类型名)对象名;
·使用GetType可以取得任何对象的精确类型;
·基本类型可以使用Covert类实现类型转换;
·除了string以外的其他类型都有Parse方法,用于将字符串类型转换为对应的基本类型;
值类型和引用类型的转换机制称为装箱(boxing)和拆箱(unboxing)。
3. 原理与示例说明
浅谈了类型转换的几个普遍关注的方面,该将主要精力放在is、as操作符的恩怨情仇上了。类型转换将是个较大的话题,留于适当的时机讨论。
is/as操作符,是C#中用于类型转换的,提供了对类型兼容性的判断,从而使得类型转换控制在安全的范畴,提供了灵活的类型转换控制。
is的规则如下:
·检查对象类型的兼容性,并返回结果,true或者false;
·不会抛出异常;
·如果对象为null,则返回值永远为false。
其典型用法为:
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
Controversy arouses in the character that C# adds newly have a lot of,Branch method (Partial Method) is.Branch method is by the definition normally in division of a cent,Kind of file in convention is medium also can come true.If branch method is done not have by implementation,Compile implement won't, undertake compiling to them.
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
1:Use String.Replace function is replaced,But do not support big the ordinary form of a Chinese numeral.
2:criterion System.Text.Regex is replaced,Revise with RegExpOption whether to support big the ordinary form of a Chinese numeral.
3:Below the circumstance of little data,Use String.SubString and + can come true to be replaced secondhand.
4:Guide Microsoft Visual Basic RunTime (Microsoft.VisualBasic.DLL) uses Strings.Replace rate very fast.
5:Consult reflection Reflector.FileDisassembler cooperates the implementation such as Strings.Split And Strings.Join,Speed is the same as 5.
Introduction a kind of algorithm,Similar KMP is algorithmic.Those who have fun at consult below research.
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
(1) not be in analyse form function.Close () data layer.
(2) do not use complex list to accuse as far as possible,Too big,Come according to demand,In.NET,Those who pay attention to is to accuse a process designing,With respect to the process designing that dispute string outputs,Those who derive is time,Entrust etc,A lot of moment,Successive IX interface writes him,Such likelihoods suit more.
(3) Using System;
Public Sealed Class Singleton
{Private Static Volatile Singleton Instance;Private Static Object SyncRoot = New Object();
Private Singleton() {}
Public Static Singleton Instance
{Get
{If (instance==Null)
{Lock (syncRoot)
{If (instance==Null)Instance = New Singleton();
}
}
Return Instance;
}
}
}
Such Get boy or girl friends are better.
(4) in object of a Connection,If had established the target of the Conntion of SqlCommand,Open when the record when wanting to carry out,If jump out to carry out again,On one operation will be carried out twice,This is like the Inline inside C++ .
(5) Sp_help is a good thing,Sp_x is very pretty good.
(6) MSSQL sets field number label to list again:
...
Posted in Asp.net Tutorials | Tags:
Tuesday, March 03, 2009 by rain
is written in the order with average ASP.Net in,Inside uses data,Date time is a kind of special data kind,Also be often be used.The data type that uses numerical value in the date time data in Visual Basic.NET is saved,And have range.The limits of date is the Christian era 1 year on January 1 ~ the Christian era 9999 day of 3 1 of 1 2 month,The limits of time is 00:00:00 ~ 23:59:59.Statement form is as follows:
...
Posted in Asp.net Tutorials | Tags: