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

C# post表单

2010这个元旦太无聊了,于是找了个奇迹游戏私服耍,在玩的过程中发现总是要登录到网站上去转生加点之类的操作,1次2次还好,100次你就郁闷了,于是自己想写个简单的程序来做。
以下就是代码部分啦:
(需要注意的是WebClient的Cookie部分)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace ZSMU
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
WebClient client = new WebClient();
client.Headers.Add("Accept", "*/*");
client.Headers.Add("Accept-Encoding", "gzip, deflate");
client.Headers.Add("Accept-Language", "zh-cn");
client.Headers.Add("Cache-Control", "no-cache");
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");//必填项目
//myWebClient.Headers.Add("Connection", "Keep-Alive");
client.Headers.Add("Referer", "http://www53.292mu.com/usezs.asp");
byte[] byteArray = Encoding.Default.GetBytes("mfkuserchr=%C2%BD%C9%CF%B5%C4%D3%E3&mfkusername=admin&mfkpassword=123456");//将提交的数据转化为byte数组
string resposeData = Encoding.Default.GetString(client.UploadData("http://www53.292mu.com/usezs.asp", "post", byteArray));
resposeData=resposeData.Remove(0, resposeData.IndexOf("alert('") + 7);
resposeData=resposeData.Remove(resposeData.IndexOf(")") - 1);
resposeData=resposeData.Replace("\\n", "");
client.Dispose();
MessageBox.Show(resposeData);
}
priv


相关文档:

C# 加密-加密后为何有两种结果的字符串?

问:C# 加密后为何有两种结果的字符串?
比如 cftea 的 MD5 加密后:
有的人的结果是:c2e1861ca90e67ce1f9a62f9c27d8bdc
有的人的结果是:wuGGHKkOZ84fmmL5wn2L3A
答:这是对字节的两种不同表示结果。
第一种是用十六进制表示的(FormsAuthentication.HashPasswordForStoringInConfigFile 就是这种,只是是大写的), ......

c# 验证码组件 可vb,asp,net调用

      今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
      csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......

C# 生成XML时的特殊字符出现异常处理

生成端处理
将要写入的值的前后写上如:"<![CDATA[" + string+ "]]>";
XmlNode xnformchild = doc.CreateNode(XmlNodeType.Element, dc.ColumnName.ToUpper(), "");
try
{
xnformchild.InnerXml = drform[dc.ColumnName].ToString( ......

asp.net c# request常用

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace pub.mo
{
public class request
{
private request() { }
/// <summary>
/// 获取session
/// </summary>
/// <param name="_session_name" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号