那是我的代码:
OpenLayers.ProxyHost =“http:// * :8080 / geoexplorer / proxy /?url =”;
答案 0 :(得分:0)
现在正在运作。
namespace KaskiGIS
{
public class Proxy : System.Web.IHttpHandler
{
public void ProcessRequest(System.Web.HttpContext context)
{
var request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(context.Request["url"]);
request.Method = context.Request.HttpMethod;
if (request.Method == "POST")
{
var content = new System.Text.UTF8Encoding().GetBytes(new System.IO.StreamReader(context.Request.InputStream).ReadToEnd());
request.ContentLength = content.Length;
using (var stream = request.GetRequestStream())
{
stream.Write(content, 0, content.Length);
stream.Close();
}
}
var response = request.GetResponse().GetResponseStream();
if (response == null) return;
context.Response.Write(new System.IO.StreamReader(response).ReadToEnd());
}
public bool IsReusable { get { return false; } }
}
}