获取转向地址的URL的源文件(可自定义REFER)

2016-02-19 11:54 43 1 收藏

生活已是百般艰难,为何不努力一点。下面图老师就给大家分享获取转向地址的URL的源文件(可自定义REFER),希望可以让热爱学习的朋友们体会到设计的小小的乐趣。

【 tulaoshi.com - Web开发 】

软件下载:
http://test.fzclx.com/caixi/geturl.rar



程式源文件:

CS打包:http://test.fzclx.com/caixi/geturl.cs.rar


c#写的,可能要先安装framework.
http://www.microsoft.com/downloads/info.aspx?na=0&p=4&SrcDisplayLang=zh-cn&SrcCategoryId=&SrcFamilyId=&genscs=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d262d25e3-f589-4842-8157-034d1e7cf3a3%26displaylang%3dzh-cn


下面是代码:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
using System.IO;

namespace WindowsApplication4
{
        /// summary
        /// Form1 的摘要说明。
        /// /summary
        public class Form1 : System.Windows.Forms.Form
        {
                private System.Windows.Forms.Label label2;
                private System.Windows.Forms.Button button1;
                private System.Windows.Forms.Label label1;
                private System.Windows.Forms.TextBox realurl;
                private System.Windows.Forms.TextBox formurl;
                private System.Windows.Forms.Label label3;
                private System.Windows.Forms.TextBox formreferer;
                private System.Windows.Forms.Panel panel1;
                /// summary
                /// 必需的设计器变量。
                /// /summary
                private System.ComponentModel.Container components = null;

                public Form1()
                {
                        //
                        // Windows 窗体设计器支持所必需的
                        //
                        InitializeComponent();

                        //
                        // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
                        //
                }

                /// summary
                /// 清理所有正在使用的资源。
                /// /summary
                protected override void Dispose( bool disposing )
                {
                        if( disposing )
                        {
                                if (components != null)
                                {
                                        components.Dispose();
                                }
                        }
                        base.Dispose( disposing );
                }

                #region Windows 窗体设计器生成的代码
                /// summary
                /// 设计器支持所需的方法 - 不要使用代码编辑器修改
                /// 此方法的内容。
                /// /summary
                private void InitializeComponent()
                {
                        System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
                        this.formurl = new System.Windows.Forms.TextBox();
                        this.label2 = new System.Windows.Forms.Label();
                        this.button1 = new System.Windows.Forms.Button();
                        this.label1 = new System.Windows.Forms.Label();
                        this.realurl = new System.Windows.Forms.TextBox();
                        this.label3 = new System.Windows.Forms.Label();
                        this.formreferer = new System.Windows.Forms.TextBox();
                        this.panel1 = new System.Windows.Forms.Panel();
                        this.SuspendLayout();
                        //
                        // formurl
                        //
                        this.formurl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.formurl.ForeColor = System.Drawing.SystemColors.WindowText;
                        this.formurl.Location = new System.Drawing.Point(24, 32);
                        this.formurl.Name = "formurl";
                        this.formurl.Size = new System.Drawing.Size(288, 21);
                        this.formurl.TabIndex = 0;
                        this.formurl.Text = "http://";
                        this.formurl.TextChanged += new System.EventHandler(this.formurl_TextChanged);
                        //
                        // label2
                        //
                        this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
                        this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
                        this.label2.Location = new System.Drawing.Point(24, 16);
                        this.label2.Name = "label2";
                        this.label2.Size = new System.Drawing.Size(128, 17);
                        this.label2.TabIndex = 2;
                        this.label2.Text = "输入你要获取的网址:";
                        this.label2.Click += new System.EventHandler(this.label2_Click);
                        //
                        // button1
                        //
                        this.button1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(64)), ((System.Byte)(64)), ((System.Byte)(64)));
                        this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
                        this.button1.Location = new System.Drawing.Point(320, 32);
                        this.button1.Name = "button1";
                        this.button1.Size = new System.Drawing.Size(56, 64);
                        this.button1.TabIndex = 3;
                        this.button1.Text = "获取…";
                        this.button1.Click += new System.EventHandler(this.button1_Click);
                        //
                        // label1
                        //
                        this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
                        this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
                        this.label1.Location = new System.Drawing.Point(24, 104);
                        this.label1.Name = "label1";
                        this.label1.Size = new System.Drawing.Size(128, 17);
                        this.label1.TabIndex = 5;
                        this.label1.Text = "真实的网址:";
                        this.label1.Click += new System.EventHandler(this.label1_Click);
                        //
                        // realurl
                        //
                        this.realurl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.realurl.ForeColor = System.Drawing.Color.OrangeRed;
                        this.realurl.Location = new System.Drawing.Point(24, 120);
                        this.realurl.Name = "realurl";
                        this.realurl.Size = new System.Drawing.Size(352, 21);
                        this.realurl.TabIndex = 4;
                        this.realurl.Text = "";
                        //
                        // label3
                        //
                        this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
                        this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
                        this.label3.Location = new System.Drawing.Point(24, 56);
                        this.label3.Name = "label3";
                        this.label3.Size = new System.Drawing.Size(128, 17);
                        this.label3.TabIndex = 7;
                        this.label3.Text = "伪装来路:";
                        //
                        // formreferer
                        //
                        this.formreferer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.formreferer.Location = new System.Drawing.Point(24, 72);
                        this.formreferer.Name = "formreferer";
                        this.formreferer.Size = new System.Drawing.Size(288, 21);
                        this.formreferer.TabIndex = 6;
                        this.formreferer.Text = "http://";
                        //
                        // panel1
                        //
                        this.panel1.BackColor = System.Drawing.Color.LightGray;
                        this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                        this.panel1.Location = new System.Drawing.Point(18, 13);
                        this.panel1.Name = "panel1";
                        this.panel1.Size = new System.Drawing.Size(364, 130);
                        this.panel1.TabIndex = 8;
                        //
                        // Form1
                        //
                        this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
                        this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
                        this.ClientSize = new System.Drawing.Size(392, 165);
                        this.Controls.Add(this.label3);
                        this.Controls.Add(this.formreferer);
                        this.Controls.Add(this.label1);
                        this.Controls.Add(this.realurl);
                        this.Controls.Add(this.button1);
                        this.Controls.Add(this.label2);
                        this.Controls.Add(this.formurl);
                        this.Controls.Add(this.panel1);
                        this.Name = "Form1";
                        this.Text = "取得真实URL -- 落伍的caixi www.im286.com";
                        this.Load += new System.EventHandler(this.Form1_Load);
                        this.ResumeLayout(false);

                }
                #endregion

                /// summary
                /// 应用程序的主入口点。
                /// /summary
                [STAThread]
                static void Main()
                {
                        Application.Run(new Form1());
                }

                private void Form1_Load(object sender, System.EventArgs e)
                {

                }

                private void label2_Click(object sender, System.EventArgs e)
                {

                }

                private void button1_Click(object sender, System.EventArgs e)
                {        
                        string Theurl=formurl.Text;
                        string Referurl=formreferer.Text;
                        if (Theurl.Length10)
                        {
                                MessageBox.Show("兄弟,URL不正确吧","URL不正确");
                                formurl.Focus();
                        }
                        else
                        {
                                HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(Theurl);
                                myReq.Referer=Referurl;
                                HttpWebResponse myres=(HttpWebResponse)myReq.GetResponse();
                                bool hasChanged = (myReq.RequestUri != myReq.Address);
                                string geturl;
                                if (hasChanged){
                                        geturl=myReq.Address.ToString();
                                }
                                else{
                                        geturl=myReq.RequestUri.ToString();
                                }
                                realurl.Text=geturl;
                                realurl.Focus();
                        }
                }

                private void label1_Click(object sender, System.EventArgs e)
                {

                }

                private void formurl_TextChanged(object sender, System.EventArgs e)
                {

                }
        }

来源:http://www.tulaoshi.com/n/20160219/1599055.html

延伸阅读
《死侍》自定义键位心得完美自定义键位 方式1: Q作为传送反击键,鼠标左键轻击,右键重击,中键开枪,E键瞄准放大,R重装和互动,ZXC分别对应键盘的轻枪重,其他不变。 鼠标左键轻击,右键重击,中键开枪,这个几乎没什么可说的。 ZXC的定义是不想占用其他键位,再就是方便看刚开始了解连招,也比较形象和对称,有时还可以用来释放动...
  仅仅依靠Authorware 6.0本身的功能和它所提供的系统函数,来提高Authorware多媒体程序的灵活性是不够的。有些时候,用户需要利用其他的开发工具来生成用户自定义函数,用来拓展程序的功能。本章向大家展示的就是有关于这方面的应用。 1 概述1.1 什么是用户自定义函数 UCD的全名是User Code Dll,是用户自定义函数的缩写。目前任何...
PowerPoint借助自定义形状实现填充自定义图片   具体如何操作呢?以powerpoint2007为例,先在PPT页面中画一Tulaoshi.Com个形状,就像下面这个圆: 然后在形状填充里面选择图片或纹理填充: 插入自文件,选择想要的图片就OK了,就会出现下面的效果: 同样的效果还可以应用于艺术字(文本框不行)。如下: ...
WinRAR如何启动定位的自定义的文件夹   电脑中有个文件夹专门存放下载或自己压缩的RAR文件。WinRAR默认情况启动时恢复到上次工作的文件夹,要想让WinRAR定位的自定义的文件夹,就得将该文件夹设置为启动文件夹。下面话不多小姐给大家介绍操作方法。 例如在H盘有一个RAR文件的文件夹,专门存放RAR压缩文件。 单击桌面上的...
标签: Web开发
一、基本概念: 1.标签(Tag): 标签是一种XML元素,通过标签可以使JSP网页变得简洁并且易于维护,还可以方便地实现同一个JSP文件支持多种语言版本。由于标签是XML元素,所以它的名称和属性都是大小写敏感的 2.标签库(Tag library): 由一系列功能相似、逻辑上互相联系的标签构成的集合称为标签库。 3.标签库描述文件(Tag Library Desc...

经验教程

803

收藏

23
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部