c# 登录新浪源码
看到网上很多人找新浪登录的源代码,甚至发到威客上去了,有钱人啊.下面是本人写的新浪登录和发布博文的源码,有需要的就拿去用吧(这好像会破了某些人的财路啊,真不好意思了) 版本所有Q:302777528
public static string pSina(string user,string psw,string title,string txt)
{
myDomain(container);
//login
string url = "http://login.sina.com.cn/js(v6.3.7)";
string pData = string.Format("service=sso&client=ssologin.js%28v1.3.7%29&entry=sso&encoding=GB2312&gateway=1&savestate=0&from=&useticket=0"
);
string content = Execute(url, "post", pData);
writeS(url, "login");
myDomain(container);
//personal Powered BY Error
//url = "http://i.blog.sina.com.cn/byerror/index.php?com=1";
//content= Execute(url,"get","");
//myDomain(container);
//pr_Create and Get url = "http://control.blog.sina.com.cn/myDomain/article_add.php";
//write it for test"/>
content = Execute(url, "get", "");
string strDatePub = myMatch(content, "(?<=input type=\"hidden\" name=\"date_pub\" id=\"date_pub\" value=\").*(?=\"/)", 0);
string strTime = myMatch(content, "(?<=<input id=\"articleTime\" name=\"time\" type=\"text\" size=\"8\" value=\").*(?=\" class)", 0);
my(container);
writeS(url, "Pre_create");
//提交文章
url = "http://control.blog.sina.com.cn/byerror/article/article_post.php";
pData = string.Format("ptype=&teams=&worldcuptags=&album=&album_cite=&=0&stag=&sno=&book_worksid=&channel_id=&url=" +
"&channel=&newsid=&fromuid=&wid=&articletj=0&assoc_article=&assoc_style=1&assoc_article_data=" +
"&article_BGM=&xRankStatus=&_preview=1&source=&topic_id=0&topic_channel=0&topic_more=&utf8=1&date_pub={3}&blog_title={1}" +
"&time={4}&blog_body={2}&blog_class=00&tag=byError&x_cms_flag=0&sina_sort_id=117&join_circle=1"
, test, HttpUtility.UrlEncode(title, .UrlEncode(txt, Encoding.GetEncoding("utf-8")), , Encoding.GetEncoding("utf-8"))
, HttpUtility.UrlEncode(strTime, Encoding.GetEncoding("utf-8")));
//pData = string.Format("ptype=&teams=&=0&stag=&sno=&book_worksid=&channel_id=&url=&channel="+
// "&newsid=&fromuid=&wid=&articletj=&test={0}&is_media=0&is_stock=0&is_tpl=0&assoc_article=&assoc_style=1&assoc_article_data=&article_BGM="+
// "&xRankStatus=&commentGlobalSwitch=&commenthideGlobalSwitch=&articleStatus_preview=1&sourcetime={1}&blog_body=ttp&blog_class=00&tag=&x_cms_flag=1&sina_sort_id=105&join_circle=1",
// strToken,test.UrlEncode("01:02:05", Encoding.GetEncoding("utf-8")));
strRefer= "http://control.blog.sina.com.cn/byerror/article/article_add.php";
System.Diagnostics.Debug.Print("pData>>>>" + pData);
content = Execute(url, "post", pData);
{
//这里返回值有问题。没改
return string.Format("http://blog.sina.com.cn/s/blog_{0}.html",myMatch(content, "(test)"0));
}
else
{
return "";
}
}
//以上是c#登录新浪源代码,其实各大博客(网易,搜弧,百度,和讯,腾讯,博客大巴blogbus)的登录和发布源代码我都有,为了照顾某些人的利益,就不好出来了需要的话Q:302777528 byError网络科技
评论已关闭