Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c#

C#ÀïµÄtreeview¿Ø¼þÈçºÎÄÜ°ó¶¨Êý¾Ý¿âÀïµÄÊý¾Ý

Ó¦ÓóÌÐò£¬´°ÌåÀïÍÏ·ÅÒ»¸öTreeView¿Ø¼þ£¬Ïë°ÑÊý¾Ý¿âÀïµÄÊý¾ÝÔÚÕâ¸ö¿Ø¼þÀïÏÔʾ³öÀ´
  TREEVIEW¿Ø¼þÊÇWinfrom´°ÌåÀïµÄ ²»ÊÇASP£®NETÀïµÄTREEVIEW
´úÂëÈçÏ£º
CREATE TABLE CateTable (
      [ID] [int] IDENTITY (1, 1) NOT NULL ,
       [CateName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
       [RootID] [int] NOT NULL ,
       [ParentID] [int] NOT NULL
)
GO

´æ´¢¹ý³Ì£º
CREATE PROCEDURE CateTable_GetList AS
BEGIN
       Select
              CateID,
              CateName,
              RootID,
              ParentID
       from
 &n ......

ͼƬÎļþÉÏ´«, Éú³É¸ßÖÊÁ¿ËõÂÔͼ (asp.net c#)

ºǫ́´úÂ룺
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
public partial class User_UpLoadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void UPbutton_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileContentType = FileUpload1.PostedFile.ContentType;
if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg")
{
string name = FileUpload1.PostedFile.FileName; // ¿Í»§¶ËÎļþ·¾¶
FileInfo file = new FileInfo(name);
string SavePath = "/upload/";
string fileExes = (System.IO.Path.GetExtension(name)).ToString().ToLower();//ÎļþÀ©Õ¹Ãû
Random ran = new Ran ......

ͼƬÎļþÉÏ´«, Éú³É¸ßÖÊÁ¿ËõÂÔͼ (asp.net c#)

ºǫ́´úÂ룺
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;
public partial class User_UpLoadFile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void UPbutton_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string fileContentType = FileUpload1.PostedFile.ContentType;
if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg")
{
string name = FileUpload1.PostedFile.FileName; // ¿Í»§¶ËÎļþ·¾¶
FileInfo file = new FileInfo(name);
string SavePath = "/upload/";
string fileExes = (System.IO.Path.GetExtension(name)).ToString().ToLower();//ÎļþÀ©Õ¹Ãû
Random ran = new Ran ......

c# web service ʵÀý

 Î¢ÈíÔÚÆä.netÕ½ÂÔÖУ¬¶ÔÆäÖ÷ÍƵÄWeb Service×öÁË´óËÁµÄÐûÑï¡£ÏÖÔÚ£¬Web
ServiceÕýÈç»ðÈçݱµØ·¢Õ¹×Å£¬Ïà¹ØµÄ¸÷Ïîм¼Êõ²ã³ö²»Çî¡£Web
ServiceµÄ·¢Õ¹Õý¹¹Öþ×Å»¥ÁªÍøʱ´úÃÀºÃµÄÃ÷Ìì¡£ÔÚ±¾ÎÄÖУ¬ÎÒ½«Ïò´ó¼Ò½éÉÜWeb ServiceµÄһЩ»ù±¾ÖªÊ¶¡¢ÈçºÎÓÃC££½¨Á¢Ò»¸öWeb
Service¡£Í¨¹ýÎÄÕ£¬ÎÒÃÇ»¹½«¶ÔWSDL¡¢UDDIÒÔ¼°Î´À´µÄWeb ServiceÓÐÒ»¸ö´óÖµÄÁ˽⡣
ΪʲôÐèÒªWeb Service£¿
ÒÔÇ°£¬·Ö²¼Ê½µÄÓ¦ÓóÌÐòÂß¼­ÐèҪʹÓ÷ֲ¼Ê½µÄ¶ÔÏóÄ£ÐÍ£¬Í¨¹ýʹÓÃDCOM¡¢CORBA¡¢RMIÖ®ÀàµÄ»ù±¾½á¹¹£¬¿ª·¢ÈËÔ±ÈÔ¿ÉÓµÓÐʹÓñ¾µØÄ£ÐÍËùÌṩµÄ·á¸»×ÊÔ´ºÍ¾«È·ÐÔ£¬²¢¿É½«·þÎñÖÃÓÚÔ¶³ÌϵͳÖС£
µ±ÒѾ­ÓÐÖÐÒâµÄÖмä¼þƽ̨£¨RMI¡¢Jini¡¢CORBA¡¢DCOM
µÈµÈ£©Ê±£¬ÎÒÃÇΪʲô»¹ÒªÎªWeb¶ø·³ÄÕÄØ£¿Öмä¼þȷʵÌṩÁËÇ¿´óµÄ·þÎñʵÏÖÊֶΣ¬µ«ÊÇ£¬ÕâЩϵͳÓÐÒ»¸ö¹²Í¬µÄȱÏÝ£¬ÄǾÍÊÇËüÃÇÎÞ·¨À©Õ¹µ½»¥ÁªÍøÉÏ£ºËüÃÇ
ÒªÇó·þÎñ¿Í»§¶ËÓëϵͳÌṩµÄ·þÎñ±¾ÉíÖ®¼ä±ØÐë½øÐнôÃÜñîºÏ£¬¼´ÒªÇóÒ»¸öͬÀà»ù±¾½á¹¹¡£È»¶øÕâÑùµÄϵͳÍùÍùÊ®·Ö´àÈõ£ºÈç¹ûÒ»¶ËµÄÖ´ÐлúÖÆ·¢Éú±ä»¯£¬ÄÇôÁíÒ»
¶Ë±ã»á±ÀÀ£¡£ÀýÈ磬Èç¹û·þÎñÆ÷Ó¦ÓóÌÐòµÄ½Ó¿Ú·¢Éú¸ü¸Ä£¬ÄÇô¿Í»§¶Ë±ã»á±ÀÀ£¡£ÎªÁËÄÜÀ©Õ¹µ½»¥ÁªÍøÔËÓã¬ÎÒÃÇÐèÒªÒ»ÖÖËÉɢżºÏµÄ»ù±¾½á¹¹À´½â¾ ......

ʹÓÃC#´´½¨webservice¼°ÈýÖÖµ÷Ó÷½Ê½


΢Èí.NETÕ½ÂÔµÄÒ»¸ö±È½ÏÖØÒªµÄ²¿·Ö¾ÍÊÇwebservice,ÀûÓÃwebserviceÎÒÃÇ¿ÉÒÔ´´½¨ÕæÕýÓÐЧµÄ·Ö²¼Ê½Ó¦ÓóÌÐò¡£
ÏÂÃ棬ÎÒÃǶÔwebservice×öһЩ˵Ã÷¡£
¼ÙÉèAÊÇ¿Í»§¶Ë£¬BÊÇwebservice·þÎñ¶Ë£¬Óû§Í¨¹ýhttpЭÒéÏò·þÎñÆ÷·¢ËÍsoapÇëÇó£¬webservice·µ»Ø¿Í»§¶ËXML¸ñʽµÄÊý¾Ý¡£
ÏÖÔÚÎÒÃÇ¿´Ò»¿´´´½¨Ò»¸öwebserviceµÄ´óÖ¹ý³Ì£º
·þ
Îñ¶ËµÄwebserviceÊDZØÐëÒª½¨µÄ¡£ÖмäµÄsoap,xmlÎÒÃDz»ÓÃÈ¥¹ØÐÄ£¬ÔÚ¿Í»§¶ËÕâ±ß£¬±È½ÏÖØÒªµÄÊÇÈçºÎ´ÓwebserviceÈ¡µÃ¶ÔÏ󣿴ð°¸
ÊÇÓõÄÊÇproxy¶ÔÏ󡣿ͻ§¶ËÓÉ´úÀí¶ÔÏó(proxy)¸ºÔðÓëwebserviceµÄͨÐÅ¡£ËùÒÔÔÚ¿Í»§¶ËʹÓÃwebservice£¬ÍêÈ«ºÍʹÓÃÒ»¸ö±¾µØ
¶ÔÏóÊÇÒ»ÑùµÄ¡£
ÎÒÃÇÏÖÔÚÒÔÒ»¸ö¼òµ¥µÄʵÀýÀ´ËµÃ÷¡£
´ò¿ªvs.net,н¨¹¤³Ì(asp.net  web·þÎñ)£¬ÔÚλÖÃÖмüÈëhttp://localhost/webserver,ÆäÖÐwebserver¾ÍÊǹ¤³ÌµÄÃû×Ö¡£È·¶¨ºó£¬³öÏÖÒ»¸öService1.asmx.cx,Ë«»÷£¬³öÏÖ´úÂë´°¿Ú£¬
using  System;
using  System.Collections;
using  System.ComponentModel;
using  System.Data;
using  System.Diagnostics;
using  System.Web;
using  System.Web.S ......

³£¼ûµÄC#ÃæÊÔÌâ


 
1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£ protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£ public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£ internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£2 .ÁоÙASP.NET Ò³ÃæÖ®¼ä´«µÝÖµµÄ¼¸ÖÖ·½Ê½¡£ ´ð. 1.ʹÓà QueryString, Èç....?id=1; response. Redirect().... 2.ʹÓà Session ±äÁ¿ 3.ʹÓà Server.Transfer3. Ò»ÁÐÊýµÄ¹æÔòÈçÏÂ: 1¡¢1¡¢2¡¢3¡¢5¡¢8¡¢13¡¢21¡¢34...... ÇóµÚ30λÊýÊǶàÉÙ£¬ÓõݹéË㷨ʵÏÖ¡£´ð£º
public class MainClass {
public static void Main() {
 Console.WriteLine(Foo(30));
 }
public static int Foo(int i){
 if (i return 0; else if(i > 0 && i return 1; else return Foo(i -1) + Foo(i - 2);
 }
 }
4.C#ÖеÄίÍÐÊÇʲô£¿Ê¼þÊDz»ÊÇÒ»ÖÖίÍУ¿´ð £º ίÍпÉÒÔ°ÑÒ»¸ö·½·¨×÷Ϊ²ÎÊý´úÈëÁíÒ»¸ö·½·¨¡£Î¯ÍпÉÒÔÀí½âΪָÏòÒ»¸öº¯ÊýµÄÒýÓá£ÊÇ£¬ÊÇÒ»ÖÖÌØÊâµÄίÍÐ5.override ÓëÖØÔصÄÇø±ð´ð £ºoverride ÓëÖØÔصÄÇø±ð¡£ÖØÔØÊÇ·½·¨µÄÃû³ÆÏàͬ¡£²ÎÊý»ò²ÎÊýÀàÐͲ»Í¬£¬½øÐжà´ÎÖØÔØÒÔÊÊÓ¦ ......

[Õª×Ô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 ......

[Õª×Ô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 ......
×ܼǼÊý:642; ×ÜÒ³Êý:107; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [98] [99] [100] [101] [102] [103] [104] 105 [106] [107]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ