Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[Õª×Ôc#Bible]c#ÖÐnamespaceµÄʹÓã¨ÃüÃû¿Õ¼ä£©

The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET developers.
Code written in a .NET language references classes by their names, and all of these classes
used together suggests an obvious dilemma: What happens if a developer wants to use two
classes that have the same name?
Suppose you write a C# class that reads records from a database and you name the class
Recordset. Code that wants to use your class may create objects as follows:
Recordset MyRecordset = new Recordset();
Now suppose that you package your classes into a .NET assembly and distribute your
assembly for use by other applications. Furthermore, suppose that someone obtains your
assembly and integrates it into his or her application. What happens if that same application
also makes use of another assembly written by someone else, which also contains a class
called Recordset? When the application code creates a new Recordset object, which class is
used to create the object: yours or the class in the other assembly?
This problem can be solved through the C# concept of name-spaces. Namespaces organize
classes under a named group, and the namespace name can be used to help distinguish
between two classes with the same name. Your C# code should use namespaces to help
further identify your classes under a common grouping, especially if you are planning to build
an assembly for use by other developers. Namespaces may even come in handy in C#
applications that you build, because your C# applications may use an external assembly that
uses class names which mirror yours.
Declaring a Namespace
You declare a namespace with the C# namespace keyword. A namespace identifier and curly
brackets follow the namespace keyword. Classes to be included in the namespac


Ïà¹ØÎĵµ£º

CÓïÑÔÔ¤±àÒë³öÀ´ÃüÁî

Ò»¡¢ºê¶¨Òå(²»´ø²ÎÊýµÄºê¶¨Òå,´ø²ÎÊýµÄºê¶¨Òå)
1.±àÒëÔ¤´¦Àí¾ÍÊǶÔCÔ´³ÌÐò½øÐбàÒëÇ°,ÓÉ"±àÒëÔ¤´¦Àí³ÌÐò"¶ÔÔ¤´¦ÀíÃüÁîÐнøÐд¦ÀíµÄ¹ý³Ì¡£
2.CÓïÑÔÖÐ,·²ÊÇÒÔ"#"¿ªÍ·µÄÐÐ,¶¼³ÆΪ"±àÒëÔ¤´¦Àí"ÃüÁîÐС£
CÓïÑÔÖеıàÒëÔ¤´¦ÃüÁîÓÐ:#define,#undef,#include,#if,#else,#elif,#endif,#ifdef,#ifndef,#line,#pragma,#error¡£ÕâÐ©Ô ......

C/C++ÖеÄstatic

C++ÖеÄStaticÓÐÁ½¸ö×÷Óá£
1¡¢ ¾²Ì¬¾Ö²¿±äÁ¿ 
   ¾²Ì¬¾Ö²¿±äÁ¿ÔÚº¯ÊýÄÚ¶¨Òå ËüµÄÉú´æÆÚΪÕû¸öÔ´³ÌÐò£¬µ«ÊÇÆä×÷ÓÃÓòÔڸú¯ÊýÄÚ£¬Ö»ÄÜÔÚ¶¨Òå¸Ã±äÁ¿µÄº¯ÊýÄÚʹÓøñäÁ¿¡£ ÔÊÐí¶Ô¹¹ÔìÀྲ̬¾Ö²¿Á¿¸³³õÖµ£¬Èôδ¸³ÒÔ³õÖµ£¬ÔòÓÉϵͳ×Ô¶¯¸³ÒÔ0Öµ¡£ 
void fun1()
{
static int i = 0;
......

090928ÈÕcÓïÑÔѧϰÈռǣ¨ÎļþI/O)

#include<stdio.h>
#include<stdlib.h>
#define MAX 41
static int i=0;
int main(void)
{
FILE *fp;
char words[MAX];
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stdout,"Can't open \" word\" file\n");
exit(1);
}
puts("Enter words to add to the file,press the enter.");
......

ÓÉC#·ç³±ÏëÆðµÄ£­¸ø³õѧ±à³ÌÕßµÄÖÒ¸æ

 ÎÒʼÖÕÈÏΪ£¬¶ÔÒ»¸ö³õѧÕßÀ´Ëµ£¬IT½çµÄ¼¼Êõ·ç³±ÊDz»¿ÉÒÔ×·¸ÏµÄ£¬¶øÇÒҲûÓÐÄÜÁ¦È¥×·
¸Ï¡£ÎÒʱ³£¿´¼û×Ô¼ºµÄDDMMÃǰѿα¾ÈÓÁË£¬È¥ÂôЩ¼Û¸ñ²»·ÆµÄÖîÈçC#, VB.Net ÕâÑùµÄ´ó²¿
Í·£¬ÕâÈÃÎҸе½·Ç³£Í´ÐÄ¡£¶øÐí¶à¸ã²»ÇåÖ¸ÕëÊÇÕ¦»ØʵÄBBSÕ¾ÓÑü·ÉÉ«ÎèµÄÌÖÂÛC#ÀïÃæ¿É
ÒÔ²»ÓÃÖ¸ÕëµÈµÈÔòÈÃÎÒ¾õµÃºÃЦ¡£C#¾ÍÏóµ±ÄêµÄASPÒ»Ñù ......

c# web service ʵÀý

 Î¢ÈíÔÚÆä.netÕ½ÂÔÖУ¬¶ÔÆäÖ÷ÍƵÄWeb Service×öÁË´óËÁµÄÐûÑï¡£ÏÖÔÚ£¬Web
ServiceÕýÈç»ðÈçݱµØ·¢Õ¹×Å£¬Ïà¹ØµÄ¸÷Ïîм¼Êõ²ã³ö²»Çî¡£Web
ServiceµÄ·¢Õ¹Õý¹¹Öþ×Å»¥ÁªÍøʱ´úÃÀºÃµÄÃ÷Ìì¡£ÔÚ±¾ÎÄÖУ¬ÎÒ½«Ïò´ó¼Ò½éÉÜWeb ServiceµÄһЩ»ù±¾ÖªÊ¶¡¢ÈçºÎÓÃC££½¨Á¢Ò»¸öWeb
Service¡£Í¨¹ýÎÄÕ£¬ÎÒÃÇ»¹½«¶ÔWSDL¡¢UDDIÒÔ¼°Î´À´µÄWeb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ