Ó¦ÓóÌÐò£¬´°ÌåÀïÍÏ·ÅÒ»¸ö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 ......
ºǫ́´úÂ룺
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 ......
ºǫ́´úÂ룺
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 ......
΢ÈíÔÚÆä.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¶ø·³ÄÕÄØ£¿Öмä¼þȷʵÌṩÁËÇ¿´óµÄ·þÎñʵÏÖÊֶΣ¬µ«ÊÇ£¬ÕâЩϵͳÓÐÒ»¸ö¹²Í¬µÄȱÏÝ£¬ÄǾÍÊÇËüÃÇÎÞ·¨À©Õ¹µ½»¥ÁªÍøÉÏ£ºËüÃÇ
ÒªÇó·þÎñ¿Í»§¶ËÓëϵͳÌṩµÄ·þÎñ±¾ÉíÖ®¼ä±ØÐë½øÐнôÃÜñîºÏ£¬¼´ÒªÇóÒ»¸öͬÀà»ù±¾½á¹¹¡£È»¶øÕâÑùµÄϵͳÍùÍùÊ®·Ö´àÈõ£ºÈç¹ûÒ»¶ËµÄÖ´ÐлúÖÆ·¢Éú±ä»¯£¬ÄÇôÁíÒ»
¶Ë±ã»á±ÀÀ£¡£ÀýÈ磬Èç¹û·þÎñÆ÷Ó¦ÓóÌÐòµÄ½Ó¿Ú·¢Éú¸ü¸Ä£¬ÄÇô¿Í»§¶Ë±ã»á±ÀÀ£¡£ÎªÁËÄÜÀ©Õ¹µ½»¥ÁªÍøÔËÓã¬ÎÒÃÇÐèÒªÒ»ÖÖËÉɢżºÏµÄ»ù±¾½á¹¹À´½â¾ ......
΢Èí.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 ......
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 ÓëÖØÔصÄÇø±ð¡£ÖØÔØÊÇ·½·¨µÄÃû³ÆÏàͬ¡£²ÎÊý»ò²ÎÊýÀàÐͲ»Í¬£¬½øÐжà´ÎÖØÔØÒÔÊÊÓ¦ ......
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 ......
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 ......