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

ÔÚasp.net webserviceÖÐÈçºÎʹÓÃsession

Ô­ÎÄ£ºÁõÎä|ÔÚasp.net webserviceÖÐÈçºÎʹÓÃsession  
ÔÚʹÓÃasp.net±àдwebserviceʱ£¬Ä¬ÈÏÇé¿öÏÂÊDz»Ö§³ÖsessionµÄ£¬µ«ÎÒÃÇ¿ÉÒÔ°ÑWebMethodµÄEnableSessionÑ¡ÏîÉèΪtrueÀ´ÏÔʽµÄ´ò¿ªËü£¬Çë¿´ÒÔÏÂÀý×Ó£º
1 н¨ÍøÕ¾WebSite 
2 н¨web·þÎñWebService.asmx£¬Ëü¾ßÓÐÒÔÏÂÁ½¸ö·½·¨£º
C#-Code:
[WebMethod(EnableSession = true)]
public string Login(string name)
{
    Context.Session["name"] = name;
    return name;
}
[WebMethod(EnableSession = true)]
public string GetName()
{
    if (Context.Session["name"] != null)
        return Context.Session["name"].ToString();
    else
        return "";
}
3 Ìí¼Óasp.netÒ³ÃæSessionInWebservice.aspx
ASP.NET-Code:
<form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <asp:Button ID="btnLogin" runat="server"
            Text="Login" OnClick="btnLogin_Click" />
    </div>
    <div>
        <asp:Button ID="btnGetName" runat="server"
            Text="GetName" OnClick="btnGetName_Click" />
        <asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
    </div>
</form>
SessionInWebservice.aspx.cs
C#-Code:
protected void btnLogin_Click(object sender, EventArgs e)
{
    WebService ws = new WebService();
   
    ws.Login(txtName.Text);
}
protected void btnGetName_Click(object sender, EventArgs e)
{
    WebService ws = new WebService();
    lblNa


Ïà¹ØÎĵµ£º

ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤

ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤
    ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ­³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«F ......

asp.net»ñÈ¡µ±Ç°Ê±¼ä

ÔÚc# / ASP.netÖÐÎÒÃÇ¿ÉÒÔͨ¹ýʹÓÃDataTimeÕâ¸öÀàÀ´»ñÈ¡µ±Ç°µÄʱ¼ä¡£Í¨¹ýµ÷ÓÃÀàÖеĸ÷ÖÖ·½·¨ÎÒÃÇ¿ÉÒÔ»ñÈ¡²»Í¬µÄʱ¼ä£ºÈ磺ÈÕÆÚ£¨2008-09-04£©¡¢Ê±¼ä£¨12£º12£º12£©¡¢ÈÕÆÚ+ʱ¼ä£¨2008-09-04 12£º11£º10£©µÈ¡£
//»ñÈ¡ÈÕÆÚ+ʱ¼ä
DateTime.Now.ToString();            // 2008- ......

Asp.net Ajax webserviceʱ¼ä´Á

  ÔÚʹÓÃAJAX½øÐгÌÐò¿ª·¢µÄʱºò£¬Ò»Ö±¶¼»áÃæ¶ÔÒ»¸ö»º´æµÄÎÊÌ⣡£¡
¼´ÊÇ£¬ÉÏ´ÎÇëÇóµÄʱºò£¬ÒòΪÄãµÄSQLÓï¾ä»òÕßÆäËûÔ­Òò£¬webserviceÖзµ»ØֵΪ¿Õ£¬²»ÊÇÄãÏëÒªµÄ½á¹û¼¯£¬ÔÚÄã·¢ÏÖwebserviceÖÐÓï¾äÌå³ö´íºó£¬½øÐÐÐ޸ģ¬ÖØвâÊÔ£¬ÈÔÈ»ÊÇÉϴεķµ»Ø½á¹û£¡¸Ð¾õ¾ÍÏñÄãµÄÐÞ¸ÄÍêÈ«ÎÞЧ¡£¡£
   Æäʵ£¬ÕâÊÇÔÚAJAXµ ......

asp.net¿ØÖÆÍøÕ¾·Ö±æÂÊ

¿ØÖÆÍøÕ¾·Ö±æÂÊ ÎÒÃÇ¿ÉÒÔ Óà frameset
ËäÈ» asp.net²»Ö§³ÖÕâ¸öÊôÐÔ µ«Êǹ¦ÄÜÊÇ¿ÉÒÔʵÏÖµÄ
Èç £º
<frameset name="main" rows="105,*" frameborder="no" border="0" framespacing="0">
  <frame src="xx.aspx" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" /> ......

apss asp.net C# web ¶¨Ê±Ö´ÐгÌÐò

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Timers;
using System.Data;
using System.Data.SqlClient;
namespace SMS_joke
{
/// <summary>
/// Global µÄժҪ˵Ã÷¡£
/// </summary>
public class ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ