奋斗的小土豪
优秀如我,哈哈哈哈哈哈哈。

 一、返回页面

                 string uri = "http://localhost:19432/Home/WeiZhanHomePage?templateID=T0019";
                
                WebClient wc = new WebClient();
                Stream resStream = wc.OpenRead(uri);
                StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default);
                string ContentHtml = sr.ReadToEnd();
                var response = new HttpResponseMessage();
                response.Content = new StringContent(ContentHtml);
                response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
                return response;

二、跳转指定路径

 

              HttpResponseMessage resp = new HttpResponseMessage(HttpStatusCode.Moved);
             resp.Headers.Location = new Uri(uri);
             return resp;

posted on 2020-11-05 17:20  奋斗小土豪  阅读(903)  评论(0编辑  收藏  举报