asp.net web serviceʵÀý
×î½üÏëÑо¿ÏÂweb service,ÄκÎÕÒ±éÍøÂ磬¶¼Êǽ²Ð©¶¨ÒåÐԵĶ«Î÷£¬·º·º¶ø̸£¬ÎÒ¿´µÄÒ»Öª°ë½â£¬²»µÃÒªÁì¡£²»¹ý½ñÌì×ÜËãÓеãÊÕ»ñ£¬Ð´ÁË ¸öСµÄweb serviceÀý×Ó£¬¾ÍÊÇÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý¡£»¹ÊÇÀÏ»°£¬¸ø´ó¼ÒÆðÅ×שÒýÓñµÄ×÷Óã¬Ö»ÊǸø´ó¼Ò½²½âÈçºÎ¿ª·¢×î¼òµ¥µÄ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»ÊÇÖÊÊý
/// </summary>
/// <param name="number">ÒªÅжϵÄÊý</param>
/// <returns>·µ»Ø½á¹û</returns>
[WebMethod(Description = "ÅжÏÒ»¸öÊýÊDz»ÊÇÖÊÊý")] //ÉùÃ÷´Ëº¯ÊýΪweb service·½·¨£¬¿ÉÒÔ¹©Íâ ½çµ÷ÓÃ
public string IsPrimeNumber(int number)
{
// ÒÔÏÂΪËã·¨£¬Ã²ËƲ»ÊÇ×îÓŵÄ
string value = "";
if (number <= 0)
{
&
Ïà¹ØÎĵµ£º
ÉèÖÃÏÂÀ¿òµÄ³õʼֵ£º
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Text="Сѧ" Value="1"></asp:ListItem>
<asp:ListItem Text="ÖÐѧ" Value="2"></asp:ListItem& ......
»ñÈ¡ÇëÇóµÄÒ³µÄ HttpRequest ¶ÔÏó¡£
Ò»¡¢HttpRequest Àà
ʹ ASP.NET Äܹ»¶ÁÈ¡¿Í»§¶ËÔÚ Web ÇëÇóÆڼ䷢Ë굀 HTTP Öµ¡£
ÏÂÃæµÄ´úÂëʾÀýʹÓà StreamWriter ÀཫÈô¸É HttpRequest ÀàÊôÐÔÖµµÄֵдÈëÎļþ¡£¶ÔÓÚÊÇ×Ö·û´®ÀàÐ͵ÄÊôÐÔ£¬ÊôÐÔÖµ±»Ð´ÈëÎļþʱ½«±»±àÂëΪ HTML¡£±íʾ¼¯ºÏµ ......
² Oracle9iµÄ°²×°£¬Çë²ÎÕÕ¹Ù·½µÄ°²×°ËµÃ÷¡£
² Oracle9i°²×°³É¹¦ÒÔºó£¬Ê¹ÓùÜÀíÔ±£¨Óû§Ãû£ºsys¡¢ÃÜÂ룺sys£©µÄÉí·ÝµÇ¼½øÈ¥£¬´´½¨Ò»¸öÓû§ddymis£¬ÃÜÂ룺ddymis,½ÇɫĬÈϸ³Óèdba¡£
² ......
»ñÈ¡ÇëÇóµÄÒ³µÄHttpApplicationState ¶ÔÏó¡£
Ò»¡¢HttpApplicationState Àà
×÷ÓãºÆôÓà ASP.NET Ó¦ÓóÌÐòÖжà¸ö»á»°ºÍÇëÇóÖ®¼äµÄÈ«¾ÖÐÅÏ¢¹²Ïí¡£
ASP.NET Ó¦ÓóÌÐòµÄ¸ÅÄÊǵ¥¸ö Web ·þÎñÆ÷ÉϵÄij¸öÐéÄâĿ¼¼°Æä×ÓĿ¼·¶Î§ÄÚµÄËùÓÐÎļþ¡¢Ò³¡ ......
дͼƬc:\1.jpgµ½±ícinfoÖÐ
private static void AddCinfo()
{
string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
S ......