- 博客(0)
- 资源 (9)
- 收藏
- 关注
C#秒拍源码
//用于登录
public bool Login(string userName, string password, out CookieCollection ccReturned)
{
HttpWebRequest request;
HttpWebResponse response;
request = (HttpWebRequest)HttpWebRequest.Create("http://login.taobao.com/member/login.jhtml");
request.CookieContainer = new CookieContainer();
string data = @"TPL_username=" + userName + "&TPL_password=" + password + "&TPL_checkcode=&need_check_code=&_tb_token_=3ae3d5fe1558&action=Authenticator&event_submit_do_login=anything&TPL_redirect_url=&from=tb&fc=2&style=default&css_style=&tid=XOR_1_000000000000000000000000000000_6A583326340B7D790D7C017F&support=000001&CtrlVersion=1%2C0%2C0%2C7&loginType=3&minititle=&minipara=&umto=Tc3d70457869e730a9a1c0256c50b5d0e%2C200&pstrong=2&llnick=&sign=&need_sign=&isIgnore=&full_redirect=&popid=&callback=&guf=¬_duplite_str=&need_user_id=&poy=&gvfdcname=10&gvfdcre=&from_encoding=";
byte[] postData = Encoding.Default.GetBytes(data);
request.Method = "POST";
request.ProtocolVersion = HttpVersion.Version11;
//request.Connection = "keep-alive";
request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.861.0 Safari/535.2";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postData.Length;
request.Referer = " http://login.taobao.com/member/login.jhtml";
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
//request.Headers.Add("Connection", "keep-alive");
request.Headers.Add("Cache-Control", "max-age=0");
request.Headers.Add("Origin", "http://login.taobao.com");
request.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
request.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
request.Headers.Add("Accept-Charset", "GBK,utf-8;q=0.7,*;q=0.3");
Stream st = request.GetRequestStream();
st.Write(postData, 0, postData.Length);
st.Close();
request.AllowAutoRedirect = false;
response = (HttpWebResponse)request.GetResponse();
ccReturned = response.Cookies;
response.Close();
return ccReturned == null? false: true;
}
2015-01-14
XPButton控件
#ifndef _BTNST_H
#define _BTNST_H
// Uncomment the following line to enable support for sound effects
#define BTNST_USE_SOUND
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// Return values
#ifndef BTNST_OK
#define BTNST_OK 0
#endif
#ifndef BTNST_INVALIDRESOURCE
#define BTNST_INVALIDRESOURCE 1
#endif
#ifndef BTNST_FAILEDMASK
#define BTNST_FAILEDMASK 2
#endif
#ifndef BTNST_INVALIDINDEX
#define BTNST_INVALIDINDEX 3
#endif
#ifndef BTNST_INVALIDALIGN
#define BTNST_INVALIDALIGN 4
#endif
#ifndef BTNST_BADPARAM
#define BTNST_BADPARAM 5
#endif
#ifndef BTNST_INVALIDPRESSEDSTYLE
#define BTNST_INVALIDPRESSEDSTYLE 6
#endif
// Dummy identifier for grayscale icon
#ifndef BTNST_AUTO_GRAY
#define BTNST_AUTO_GRAY (HICON)(0xffffffff - 1L)
#endif
class CXPButton : public CButton
{
public:
CXPButton();
~CXPButton();
enum { ST_ALIGN_HORIZ = 0, // Icon/bitmap on the left, text on the right
ST_ALIGN_VERT, // Icon/bitmap on the top, text on the bottom
ST_ALIGN_HORIZ_RIGHT, // Icon/bitmap on the right, text on the left
ST_ALIGN_OVERLAP // Icon/bitmap on the same space as text
};
enum { BTNST_COLOR_BK_IN = 0, // Background color when mouse is INside
BTNST_COLOR_FG_IN, // Text color when mouse is INside
BTNST_COLOR_BK_OUT, // Background color when mouse is OUTside
BTNST_COLOR_FG_OUT, // Text color when mouse is OUTside
BTNST_COLOR_BK_FOCUS, // Background color when the button is focused
BTNST_COLOR_FG_FOCUS, // Text color when the button is focused
BTNST_MAX_COLORS
};
enum { BTNST_PRESSED_LEFTRIGHT = 0, // Pressed style from left to right (as usual)
BTNST_PRESSED_TOPBOTTOM // Pressed style from top to bottom
};
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXPButton)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void PreSubclassWindow();
//}
2012-05-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人