[C#] 纯文本查看 复制代码
/// <summary>
/// 跳转到Web去付款
/// </summary>
private void Skip()
{
foreach (Cookie cookie in ServerAssist.ServerHelp.HttpCookie) //将cookie设置为浏览的cookie
{
API.InternetSetCookie("https://" + cookie.Domain.ToString(), cookie.Name.ToString(), cookie.Value.ToString() + ";expires=Sun,22-Feb-2099 00:00:00 GMT");
}
Process.Start("IExplore.exe", "https://kyfw.12306.cn/otn/index/init");
}
/// <summary>
/// 系统定义的API
/// </summary>
public class API
{
[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool InternetSetCookie(string A_0, string A_1, string A_2);
} |