문제

ASPX.CS 페이지에서 [WebMethod] 속성이있는 정적 메소드 내에서 httprequest.cookies에 액세스하는 방법을 아는 사람이 있습니까?

메소드가 정적이기 때문에 그렇게하지 않을 것입니다.

[WebMethod]
public static bool PostToTwitter(string identityUrl, string message, bool autoFollow)
{
  Page.Request.Cookies -- object reference is required for non-static field

감사!

도움이 되었습니까?

해결책

사용,

HttpContext.Current.Request.Cookies
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top