CookieContainer cookieContainer = new CookieContainer(); Cookie cookie = new Cookie("username", "username"); cookie.Domain = Request.Url.Host; cookieContainer.Add(cookie); // 加入Cookie HttpClientHandler httpClientHandler = new HttpClientHandler() { CookieContainer = cookieContainer, AllowAutoRedirect = true, UseCookies = true }; HttpClient httpClient = new HttpClient(httpClientHandler); var resp = httpClient.GetAsync("http://localhost:8002/Public/Passport.aspx").Result;