摘要: 纪念独立博客开博一周年,并且纪念下一年前学习flex,特弄个小Demo,顺便使用下flash buidler 4。开发需求:比如有时下载个东西,上面的地址是flashget地址,你用迅雷就无法下载,那么就要进行地址转换。要想开发这个必须知道迅雷,快车及旋风的加密方式,经过参考网上很多的此类似工具转换得出以下:【注:转载此文请注明转载地址或加上我的博客地址http://www.ajaxcn.net/...阅读全文
posted @ 2010-06-30 22:47 云飞扬IT 阅读(730) 评论(2) 编辑
摘要: 最近发现语音验证码越来越流行,比如有次在注册gmail邮箱看到过,还有msn页面也有语音验证码,还有国外一些网站等。花时间研究了下,语音验证码主要跟一般验证码的区别就在于如何让验证码播放。本文语音验证码原理:从服务器生成验证码,并保存到cookie中(getcode.aspx.cs),当点收听验证码的时候,调用javascirpt操作(这里使用jquery)cookie读取验证码,然后把验证码传到...阅读全文
posted @ 2009-11-27 00:01 云飞扬IT 阅读(3813) 评论(35) 编辑
本源码类参考http://p3p3pp3.yo2.cn开发的动态DNS程序
http://www.ajaxcn.net/archives/1671
 using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Text;
 
namespace tphp
{
    
/// <summary>
    
/// REST方式指令工具
    
/// </summary>
    public class RESTCommand
    {
        
/// <summary>
        
/// 发送指令
        
/// </summary>
        
/// <param name="URL">所在URL</param>
        
/// <param name="postinfo">指令信息</param>
        
/// <returns>返回的JSON结果</returns>
        public static string SendCommand(string URL, string postinfo)
        {
            
return htmlGetter(URL, postinfo, "UTF-8"truenullnull);
        }
 
 
        
public static string htmlGetter(string URL, string post, string codename, bool isPost, string[] headinfo, string Referer)
        {
 
            Encoding myEncoding 
= Encoding.GetEncoding(codename);
 
            HttpWebRequest request 
= (HttpWebRequest)HttpWebRequest.Create(URL);
            request.ServicePoint.Expect100Continue 
= false;
 
            
byte[] byteData = myEncoding.GetBytes(post);
            
if (isPost)
            {
                request.Method 
= "POST";
            }
            request.ContentType 
= "application/x-www-form-urlencoded";
            request.ContentLength 
= byteData.Length;
            request.UserAgent 
= "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
            
if (Referer != null)
            {
                request.Referer 
= Referer;
            }
 
            
if (headinfo != null)
            {
                
for (int i = 0; i < headinfo.Length; i++)
                {
                    request.Headers.Add(headinfo[i]);
                }
            }
 
            
//if (_isDebug)
            
//{
            
//    WebProxy myproxy = new WebProxy("127.0.0.1", 8888);
            
//    request.Proxy = myproxy;
            
//}
 
            
if (isPost)
            {
                
using (Stream requestStream = request.GetRequestStream())
                {
                    requestStream.Write(byteData, 
0, byteData.Length);
                }
            }
 
            
try
            {
                
//处理响应  
                using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
                {
                    
using (StreamReader sr2 = new StreamReader(response.GetResponseStream(), myEncoding))
                    {
                        
string rhtml = sr2.ReadToEnd();
                        
return rhtml;
                    }
                }
            }
            
catch (WebException ex)
            {
                
throw;
            }
        }
    }
 
    
/// <summary>
    
/// 序列化工具
    
/// </summary>
    public class SerializationTool
    {
        
/// <summary>
        
/// 从Jsontext获取实体
        
/// </summary>
        
/// <typeparam name="T"></typeparam>
        
/// <param name="JsonText"></param>
        
/// <returns></returns>
        public static T GetObj<T>(string JsonText)
        {
            DataContractJsonSerializer ds 
= new DataContractJsonSerializer(typeof(T));
            MemoryStream ms 
= new MemoryStream(Encoding.UTF8.GetBytes(JsonText));
            T obj 
= (T)ds.ReadObject(ms);
            ms.Close();
 
            
return obj;
        }
 
        
/// <summary>
        
/// 从实体转换到JsonText
        
/// </summary>
        
/// <param name="myobj">实体实例</param>
        
/// <returns></returns>
        public static string ParseObj(object myobj)
        {
            DataContractJsonSerializer ds 
= new DataContractJsonSerializer(myobj.GetType());
            MemoryStream ms2 
= new MemoryStream();
            ds.WriteObject(ms2, myobj);
            
string JSONString = Encoding.UTF8.GetString(ms2.ToArray());
            ms2.Close();
 
            
return JSONString;
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
 
namespace tphp
{
    
public partial class _Default : System.Web.UI.Page
    {
        
protected void Page_Load(object sender, EventArgs e)
        {
            
string pagehtml = RESTCommand.htmlGetter(@"http://www.ip138.com/ip2city.asp""""gb2312"falsenullnull);
            
string ipregex = @"您的IP地址是:\[(?<ip>.*)\]";
 
            Regex myRegex 
= new Regex(ipregex);
            Match mymatch 
= myRegex.Match(pagehtml);
 
 
            
string ipaddress = mymatch.Groups["ip"].Captures[0].Value;
            Response.Write(ipaddress);
        }
    }
}

调用ip138的页面获取IP地址

posted @ 2011-07-15 13:02 云飞扬IT 阅读(113) 评论(0) 编辑
 纪念独立博客开博一周年,并且纪念下一年前学习flex,特弄个小Demo,顺便使用下flash buidler 4。
开发需求:比如有时下载个东西,上面的地址是flashget地址,你用迅雷就无法下载,那么就要进行地址转换。
要想开发这个必须知道迅雷,快车及旋风的加密方式,经过参考网上很多的此类似工具转换得出以下:
【注:转载此文请注明转载地址或加上我的博客地址http://www.ajaxcn.net/archives/1013】
迅雷的加密的方式:
thunder://"+使用base64转换加密("AA"+下载地址+"ZZ");
代码="thunder://"+Base64.encode("AA"+txtresult.text+"ZZ");

快车的加密的方式:
flashget://"+使用base64转换加密("[FLASHGET]"+下载地址+"[FLASHGET]")+"&111";//&后可随意
旋风加密的方式:
"qqdl://"+使用base64转换加密(下载地址);
以上是加密,解密的话就是反向求出上面的下载地址
比如迅雷:先要去掉thunder:// 就是要截断去掉前10个字,然后通过base64转换解密再去掉
"AA"和"ZZ"字母,在flex中代码大致如下:
url=url.substr(10,url.length-10);
str=Base64.decode(url);
str=str.substr(2,str.length-4);
另外说明:上面 Base64.encode,Base64.decode,Base64在flex中并没有内置函数,需要引用一个as3base64.swc,
并且需要引用 import com.dynamicflash.util.Base64;具体使用不明白请参考:http://www.dynamicflash.com/goodies/base64
其它快车和旋风解密类似,具体看代码吧!
演示地址:http://www.ajaxcn.net/tools/httpconvert/httpconvert.html
源码下载地址:

  httpconver (23.8 KiB, 1 hits)


全部flex mxml文件如下:
代码
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s
="library://ns.adobe.com/flex/spark" 
               xmlns:mx
="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" >
 
    
<fx:Declarations>
        
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
    
</fx:Declarations>
<fx:Script>
    
<![CDATA[
        import com.dynamicflash.util.Base64;
 
        import mx.controls.Alert;
        import mx.utils.ArrayUtil;
        
protected function btnC_clickHandler(event:MouseEvent):void
        {
            
if(txtresult.text=='')
            {
                mx.controls.Alert.show(
"请输入链接地址");
                
return;
            }
            var str:String 
='';
            str
+="迅雷加密后:\n";
            str
+="thunder://"+Base64.encode("AA"+txtresult.text+"ZZ");
            str
+="\n";
            str
+="快车加密后:\n";
            str
+="flashget://"+Base64.encode("[FLASHGET]"+txtresult.text+"[FLASHGET]")+"&www.ajaxcn.net";
            str
+="\n";
            str
+="旋风加密后:\n";
            str
+="qqdl://"+Base64.encode(txtresult.text);
            str
+="\n";
            lblresult.text
=str;
 
        }
 
 
        
protected function btnR_clickHandler(event:MouseEvent):void
        {
            var url:String
=new String();
            url
=txtresult.text;
            var str:String
="";
            
if(url.toLowerCase().indexOf("thunder")>-1)
            {
                url
=url.substr(10,url.length-10);
                str
=Base64.decode(url);
                str
=str.substr(2,str.length-4);
                str
="迅雷解密后:"+str;
                lblresult.text
=str;
 
            }
            
else if(url.toLowerCase().indexOf("flashget")>-1)
            {
                url
=url.substr(11,(url.length-11-(url.length-url.indexOf("&"))));
                str
=Base64.decode(url);
                str
=str.substr(10,str.length-20);
                str
="快车解密后:"+str;
                lblresult.text
=str;
            }
            
else if(url.toLowerCase().indexOf("qqdl")>-1)
            {
                url
=url.substr(7,url.length-7);
                str
=Base64.decode(url);
                str
="旋风解密后:"+str;
                lblresult.text
=str;
            }
            
else
            {
                Alert.show(
"地址出错");
            }
 
 
        }
 
 
        
protected function btncopy_clickHandler(event:MouseEvent):void
        {
            System.setClipboard(lblresult.text);
            Alert.show(
"复制成功!");
        }
 
    ]]
>
</fx:Script>
    
<s:TextInput id="txtresult" x="118" y="108" width="594"/>
    
<s:Button x="731" y="106" label="加密" id="btnC" click="btnC_clickHandler(event)" />
    
<s:Button x="809" y="106" label="解密" id="btnR" click="btnR_clickHandler(event)"/>
    
<s:Label x="61" y="118" text="链接地址:"/>
    
<s:Label x="75" width="80%" y="168" text="结果:"/>
    
<s:TextArea id="lblresult" x="118" y="168" width="601"/>
    
<s:Button toolTip="把结果复制到剪切板" id="btncopy" x="727" y="246" label="复制结果" click="btncopy_clickHandler(event)"/>
    
<s:Label x="118" y="41" text="欢迎使用云飞扬IT开发的在线迅雷、快车、旋风与页面加解密" fontFamily="中易宋体" fontSize="20" width="663"/>
</s:Application> 

 

posted @ 2010-06-30 22:47 云飞扬IT 阅读(730) 评论(2) 编辑
终于解决了,折腾了装了VS2010后系统进不了,重装系统了,最后又重装出现无法创建项目,这次安装的是中文版,提示写入项目文件时出错 没有注册类别,全部更新Win 2003补丁也没用,后来点找到硬盘上VS有关的东西都点点试试,太笨了,终于试出msxml6.msi,

原创文章转载请注明出处:云飞扬IT的 blog

本文链接: http://www.ajaxcn.net/archives/994

下载地址:http://download.microsoft.com/download/b/7/1/b71d5305-618d- 4b82-858b-386db3cc4453/msxml6.msi
posted @ 2010-06-18 07:53 云飞扬IT 阅读(276) 评论(0) 编辑

安装VS 2005 或者VS2008带的SQL 2005 Express 后无法显示SQL Server Management Studio Express,需要下载一个新的安装,
下载地址: http://download.microsoft.com/download/1/1/0/110d908f-c445-4523-b939-220c7d135f3d/SQLServer2005_SSMSEE.msi

来自:http://www.ajaxcn.net/archives/794

posted @ 2010-02-19 22:08 云飞扬IT 阅读(90) 评论(0) 编辑
摘要: 最近发现语音验证码越来越流行,比如有次在注册gmail邮箱看到过,还有msn页面也有语音验证码,还有国外一些网站等。花时间研究了下,语音验证码主要跟一般验证码的区别就在于如何让验证码播放。本文语音验证码原理:从服务器生成验证码,并保存到cookie中(getcode.aspx.cs),当点收听验证码的时候,调用javascirpt操作(这里使用jquery)cookie读取验证码,然后把验证码传到...阅读全文
posted @ 2009-11-27 00:01 云飞扬IT 阅读(3813) 评论(35) 编辑
摘要: 1.NameValueCollection类集合是基于 NameObjectCollectionBase 类。但与 NameObjectCollectionBase 不同,该类在一个键下存储多个字符串值(就是键相同,值就连接起来如下例子)。该类可用于标头、查询字符串和窗体数据。每个元素都是一个键/值对。NameValueCollection 的容量是 NameValueCollection 可以保...阅读全文
posted @ 2009-11-24 22:59 云飞扬IT 阅读(268) 评论(0) 编辑
摘要: 修改了下上次写过的一篇string类与StringBuilder类性能比较 http://www.ajaxcn.net/archives/499,这次使用Stopwatch类,使计算的时间更为准确,从结果来看,字符100个string的时候要少于stringbuilder,而1000以上stringbuilder优于stringusing System;using System.Text;usin...阅读全文
posted @ 2009-11-10 12:30 云飞扬IT 阅读(171) 评论(0) 编辑
摘要: 我们都知道StringBuilder的性能要比string类,是否具体测试过呢,我这里就给出这个程序供测试,一个是Timing类,用来计算时间的。另外一个类就是分别建立string,和stringbuider类建立100,1000,10000,100000字符连接进行比较。using System;using System.Diagnostics;namespace DataStruct7{ pu...阅读全文
posted @ 2009-11-01 22:30 云飞扬IT 阅读(234) 评论(5) 编辑
摘要: 上下左右控制 吃完金币达到绿色区域。我暂时玩到第5关阅读全文
posted @ 2009-09-08 00:20 云飞扬IT 阅读(255) 评论(0) 编辑