易截截图软件、单文件、免安装、纯绿色、仅160KB

C#: 提取网页中的javascript代码

public static void Main()
        {
            WebRequest req = WebRequest.Create("http://blog.csdn.net/xiaofengsheng");
            try
            {
                WebResponse result = req.GetResponse();
                Stream ReceiveStream = result.GetResponseStream();
                StreamReader readerOfStream = new StreamReader(ReceiveStream,
                    System.Text.Encoding.GetEncoding("UTF-8"));
                string temp = readerOfStream.ReadToEnd();
                Regex ex = new Regex(
                    "<script.+?type ?= ?(\"|')text/javascript(\"|')>.*?</script>",
                    RegexOptions.Singleline);
                MatchCollection mc = ex.Matches(temp);
                foreach (Match m in mc)
                {
                    Console.WriteLin


相关文档:

[摘自c#Bible]c#中namespace的使用(命名空间)

The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET develope ......

C# ASP.NET 获取脚本语句并用文本的方式显示出来

protected void Button6_Click(object sender, EventArgs e)
    {
        this.Label11.Text = HtmlEncode(this.TextBox3.Text);
 
       
    }
    protected static string HtmlEn ......

javascript学习心得(3)

1、JavaScript信息的输入
  通过使用JavaScript中所提供的窗口对象方法prompt(), 就能完成信息的输入。该方法提供了最简便的信息输入方式,其基本格式如下:
Window.prompt("提示信", 预定输入信息);
  此方法首先在浏览器窗口中弹出一个对话框, 让用户自行输入信息。一旦输入完成后,就返回用户所输入信息的值。例: ......

javascript检测 .net Framework

通过请求的header中可以看到  User-Agent 项
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0; CIBA)
这里记录了本地信息,通过这里的.Net CLR xxxxx,可以判断 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号