asp.net

位置:IT落伍者 >> asp.net >> 浏览文章

开发ASP.NET下的MP3小偷程序


发布日期:2023年11月20日
 
开发ASP.NET下的MP3小偷程序

MP资源都在互联网上有时听不了也是正常但大多数不好用真是用处不大了仔细分析了一下它的源码原来是读取目录下的xmlxmlxml文件我经常在番茄花园听歌也就是就想能不能把番茄的MP资源放到这里来放呢?这不就是大家常说的MP小偷的功能吗?说干就干!

分析一下番茄花园的歌来源 PageUrl = _playlistasx;

目标地址xml

用程序转换格式

前台

<%@ Page language=c# Codebehind=ReadAndWriteXmlaspxcs AutoEventWireup=false Inherits=读取番茄花园的MPReadAndWriteXml validateRequest=false%>

<!DOCTYPE HTML PUBLIC //WC//DTD HTML Transitional//EN

<HTML>

<HEAD>

<title>读取番茄花园MP列表</title>

<meta content=Microsoft Visual Studio NET name=GENERATOR

<meta content=C# name=CODE_LANGUAGE

<meta content=JavaScript name=vs_defaultClientScript

<meta content= name=vs_targetSchema

</HEAD>

<body MS_POSITIONING=GridLayout

<form id=Form method=post runat=server

<FONT face=宋体

<asp:TextBox id=TextBox  runat=server

Width=px Height=px TextMode=MultiLine></asp:TextBox>

<asp:Button id=Button  runat=server

Width=px Text=修正~></asp:Button></FONT></form>

</body>

</HTML>

后台

using System;

using SystemCollections;

using SystemComponentModel;

using SystemData;

using SystemDrawing;

using SystemWeb;

using SystemWebSessionState;

using SystemWebUI;

using SystemWebUIWebControls;

using SystemWebUIHtmlControls;

using SystemIO;

using SystemNet;

using SystemText;

using SystemTextRegularExpressions;

namespace 读取番茄花园的MP

{

/// <summary>

/// WebForm 的摘要说明

/// </summary>

public class ReadAndWriteXml : SystemWebUIPage

{

protected SystemWebUIWebControlsTextBox TextBox;

protected SystemWebUIWebControlsButton Button;

private string PageUrl = ;

private void Page_Load(object sender SystemEventArgs e)

{

// 在此处放置用户代码以初始化页面

if(!IsPostBack)

{

///首先读取番茄花园的acx文件(_playlistasx)

///

PageUrl = _playlistasx;

WebClient wc = new WebClient();

wcCredentials = CredentialCacheDefaultCredentials;

Byte[] pageData = wcDownloadData(PageUrl);

string Result = EncodingDefaultGetString(pageData);

TextBoxText=Result;

}

}

#region Web 窗体设计器生成的代码

override protected void OnInit(EventArgs e)

{

//

// CODEGEN: 该调用是 ASPNET Web 窗体设计器所必需的

//

InitializeComponent();

baseOnInit(e);

}

/// <summary>

/// 设计器支持所需的方法 不要使用代码编辑器修改

/// 此方法的内容

/// </summary>

private void InitializeComponent()

{

thisButtonClick += new SystemEventHandler(thisButton_Click);

thisLoad += new SystemEventHandler(thisPage_Load);

}

#endregion

private void Button_Click(object sender SystemEventArgs e)

{

string temp=TextBoxText;

TextBoxText=<musics firstRun=\\;

TextBoxText+=temp;

TextBoxText=TextBoxTextReplace(<Asx Version=);

TextBoxText=TextBoxTextReplace(<Param Name=\AllowShuffle\ Value=\yes\/> );

TextBoxText=TextBoxTextReplace(</Asx>);

TextBoxText=TextBoxTextReplace(</Entry>);

TextBoxText=TextBoxTextReplace(<Entry>);

TextBoxText=TextBoxTextReplace(<Title><music name=\);

TextBoxText=TextBoxTextReplace(</Title>\);

TextBoxText=TextBoxTextReplace(<Ref addres=);

TextBoxText+=</musics>;

//TextBoxText=TextBoxTextReplace(\r\n);

/// 下面开始生成xml文件

///

StreamWriter swFromFileStreamUTFBuffer=new StreamWriter(ServerMapPath(/)+xmlfalseSystemTextEncodingUTF);

swFromFileStreamUTFBufferWrite(TextBoxText);

swFromFileStreamUTFBufferFlush();

swFromFileStreamUTFBufferClose();

}

}

}               

上一篇:ASP.NET性能提升秘诀之管道与进程优化

下一篇:asp.net bind()和eval()的区别