protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { TridentAgent.InternetSetCookie("http://www.edward44444.com", "JSESSIONID", "Name=edward;Expires=" + DateTime.UtcNow.AddMinutes(1).ToString("R")); int dataSize = 1000; StringBuilder sbCookie = new StringBuilder(1000); TridentAgent.InternetGetCookie("http://www.edward44444.com", "JSESSIONID", sbCookie, ref dataSize); Response.Write(sbCookie.ToString()); } }
static void Main(string[] args) { //HttpHelperTest(); //WebPageCapturer caputer = new WebPageCapturer(1024, 768); //Bitmap image = caputer.Capture("http://www.baidu.com/",3000); //image.Save("1.jpg"); TridentAgent.InternetSetCookie("http://www.edward44444.com", null, "Name=edward;Expires=" + DateTime.UtcNow.AddMinutes(1).ToString("R")); int dataSize = 1000; StringBuilder sbCookie = new StringBuilder(1000); TridentAgent.InternetGetCookie("http://www.edward44444.com", null, sbCookie, ref dataSize); //CommonCacheDependencyTest(); //FtpClientTest(); //ImageFormatInspectorTest(); //Console.Read(); }