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
相关文档:
TripleDES
属对称加密,对称加密在加密和解密时都使用相同的密钥,速度快。
TripleDESCryptoServiceProvider 的名称空间是:
System.Security.Cryptography
byte[] plaintextBuffer = System.Text.Encoding.UTF8.GetBytes("明文");
//加密
TripleDESCryptoServiceProvider tripleDES = new TripleDESCrypt ......
问:C# 加密后为何有两种结果的字符串?
比如 cftea 的 MD5 加密后:
有的人的结果是:c2e1861ca90e67ce1f9a62f9c27d8bdc
有的人的结果是:wuGGHKkOZ84fmmL5wn2L3A
答:这是对字节的两种不同表示结果。
第一种是用十六进制表示的(FormsAuthentication.HashPasswordForStoringInConfigFile 就是这种,只是是大写的), ......
原文链接:http://www.cnblogs.com/ding0910/archive/2007/07/12/815407.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using BX.Interface;
......
今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函数中执行C#代码中的函数:
方法一:1、首先建立一个按钮,在后台将调用或处理的内容写入button_click中;
&n ......