如何读取本地的cookie(100)

  • 主题发起人 主题发起人 fxb
  • 开始时间 开始时间
F

fxb

Unregistered / Unconfirmed
GUEST, unregistred user!
如何读取本地的cookie?
 
读取cookies;if Request.CookieFields.Values['CookieField1']<>'' then Response.Content :='The value for CookieField1 is ' + Request.CookieFields.Values['CookieField1'] + ''elseResponse.Content := 'Where is the cookie?';//设置cookies;var slstCookie: TStringList;beginslstCookie := TStringList.Create;try with slstCookie do begin Clear; Append('CookieExample=ACookie'); Append('CookieField1=Value1'); Append('CookieField2=Value2'); end; Response.SetCookieField (slstCookie, '', '/scripts',-1,False); Response.Content := 'Cookie has been set. Thank you!'; finally slstCookie.Free;end;end;//域名转向;var slstCookie:TStringList;beginslstCookie := TStringList.Create;try with slstCookie do begin Clear; Append('CookieExample=ACookie'); Append('CookieField1=Value1'); Append('CookieField2=Value2'); end; Response.SetCookieField (slstCookie, '', '/scripts',-1,False); Response.SendRedirect ('http://localhost/scripts/chapter9.dll/get');finally slstCookie.Free;end;end;
 
请问,要加入什么组件?
 
后退
顶部