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

asp.netдµÄweb serviceÀý×Ó

µÚÒ»£¬ н¨ÍøÕ¾£¬Ñ¡ÔñÀàÐÍΪasp.net web ·þÎñ¡£
ϵͳ×Ô¶¯ÎªÄ㽨Á¢Á˸öÎļþservice.asmx.Õâ¾ÍÊÇÒ»¸ö×î¼òµ¥µÄweb service·þÎñ¡£Äã¿ÉÒÔÖ±½ÓÔËÐв鿴Ч¹û¡£
µÚ¶þ£¬ÎÒÃÇÐèÒªµÄÊÇÐÞ¸Äservice.csÖеĴúÂ룬À´Âú×ãÎÒÃǵÄÒªÇó¡£
Ð޸ĺóµÄService.csÖеĴúÂëΪ£º
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://127.0.0.1/")]    //µ÷ÓôËweb serviceµÄµØÖ·
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    public Service () {
        //Èç¹ûʹÓÃÉè¼ÆµÄ×é¼þ£¬ÇëÈ¡Ïû×¢ÊÍÒÔÏÂÐÐ
        //InitializeComponent();
    }
    //[WebMethod]
    //public string HelloWorld() {
    //    return "Hello World";
    //}
    /// <summary>
    /// ÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý by flysky 2008-04-25
    /// </summary>
    /// <param name="number">ÒªÅжϵÄÊý</param>
    /// <returns>·µ»Ø½á¹û</returns>
    [WebMethod(Description = "ÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý")] //ÉùÃ÷´Ëº¯ÊýΪweb service·½·¨£¬¿ÉÒÔ¹©Íâ ½çµ÷ÓÃ
    public string IsPrimeNumber(int number)
    {
        // ÒÔÏÂΪËã·¨£¬Ã²ËƲ»ÊÇ×îÓŵÄ
        string value = "";
        if (number <= 0)
        {
            value = number.ToString() + "is not prime number";
            return value;
        }
        else
     &


Ïà¹ØÎĵµ£º

¹ØÓÚasp.net Session¶ªÊ§ÎÊÌâµÄ×Ü½á ¡¾×ª¡¿

aspÖÐSessionµÄ¹¤×÷Ô­Àí£º
aspµÄSessionÊǾßÓнø³ÌÒÀÀµÐԵġ£ASP Session״̬´æÓÚIISµÄ½ø³ÌÖУ¬Ò²¾ÍÊÇinetinfo.exeÕâ¸ö³ÌÐò¡£ËùÒÔµ±inetinfo.exe½ø³Ì±ÀÀ£Ê±£¬ÕâЩÐÅÏ¢Ò²¾Í¶ªÊ§¡£ÁíÍâ£¬ÖØÆð»òÕ߹رÕIIS·þÎñ¶¼»áÔì³ÉÐÅÏ¢µÄ¶ªÊ§¡£
asp.net SessionµÄʵÏÖ
asp.netµÄSessionÊÇ»ùÓÚHttpModule¼¼Êõ×öµÄ£¬HttpModule¿ÉÒÔÔÚÇëÇó±» ......

ASP.NET½âÎöxml·µ»ØÄ³½ÚµãÊôÐÔµÄÄÚÈÝ

test.xml
<?xml version="1.0" encoding="utf-8" ?>
<root>
    <R SecuCode="601600" Glossary="ѧITÍø²âÊÔ»ñÈ¡XML½á¹ûÏÔʾÕý³££¬¡£¡£¡£¡£¡£¡£¡£¹þ¹þ" />
    <R SecuCode="600056" Glossary="²âÊÔµÚ¶þ¸ö£¬¡£¡£¡£¡£¡£¡£¡£¹þ¹þ" />
</root>
ÏÂÃæxml½âÎö ......

asp.net»ñÈ¡´«ÖµgetºÍpostÇëÇó


//postÇëÇó
string name = Request["name"].toString();
string name   =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ
¶¼¿ÉÓÃstring name = Request["name"].toString();
±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µ ......

Asp.Net FormsÑéÖ¤ÎÄÕÂÖÐ×îºóµÄweb.configÎļþ

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
        <authorization>
            < ......

asp.net·ÖÒ³

1 using System;
  2 using System.Collections.Generic;
  3 using System.Collections.Specialized;
  4 using System.Linq;
  5 using System.Web;
  6 using System.Text;
  7 u ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ