有哪位大侠能否帮下忙,求一程序,实现将js文件时的代码原样显示在ie里。 如:我在ie中键入:http://127.0.0.1/demoforjs.aspx?url=http://www.people.com.cn/paper/rmrb/range.js,就能原样显示出range.js里代码在浏览器中。 说明:http://127.0.0.1/自已建立的web服务器。
demoforjs.aspx:需写的程序名称。
url:即程序的参数名.
http://www.people.com.cn/paper/rmrb/range.js:参数值。
demoforjs.aspx:需写的程序名称。
url:即程序的参数名.
http://www.people.com.cn/paper/rmrb/range.js:参数值。
解决方案 »
- 请问XMl的 SelectSingleNode的用法
- 如何用c#实现aes加密字符串后密文为一些乱码,当然保证可以解密
- winform数据显示...
- 如何获得TXT文件的字体
- 为什么在xml文件的根节点加了一个属性值就读取不到其子节点的数据了呢
- GDI+中哪个函数可以创建一个指定大小和位深的图像,并能返回该图像在内存中的首地址啊,就类似于CreateDIBSection一样。
- 实现加载插件的实例时出错
- 不安装.net framework的前提下,怎样才能运行net下编译的程序
- winform里面怎么判断一个窗口已经打开?
- 诸如VB中的REPLACE,LEFT等的函数对应的C#中是什么??
- 如何得到用户控件的接口类型呢?
- 请推荐几本C#关于WinForm编程的书,谢谢!
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string u = Request.QueryString["url"];
System.Net.HttpWebRequest webRequest = System.Net.WebRequest.Create(u) as System.Net.HttpWebRequest;
webRequest.Method = "GET"; // write the form values into the request message
System.IO.StreamReader sr = new System.IO.StreamReader(webRequest.GetResponse().GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312"));
TextBox1.Text = sr.ReadToEnd();
sr.Close();
}
</script><html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" Height="553px" TextMode="MultiLine" Width="815px"></asp:TextBox>
</form>
</body>
</html>
{
string strReturn = null ;
System.Net.HttpWebResponse resp = null;
try
{
System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
req.Method = "GET";
req.ContentType = "application/x-www-form-urlencoded";
req.AllowAutoRedirect = false;
req.ContentLength = 0;
resp = (System.Net.HttpWebResponse)req.GetResponse();
System.IO.Stream sr = resp.GetResponseStream();
System.IO.StreamReader srReader = new System.IO.StreamReader(sr); strReturn = srReader.ReadToEnd();
}
catch (Exception e)
{
throw e;
}
finally
{
if (resp != null)
{
resp.Close();
}
} return strReturn;
}