iphone搜狗输入法null微博评论显示20031(null)

新浪微博自动加关注&自动评论&批量取消关注&工具
下载地址:
新浪微博自动加关注 自动评论 批量取消关注等功能
新浪微博自动加关注 自动评论
批量取消关注等功能
新浪微博自动加关注 自动评论
批量取消关注等功能
此程序只是自己娱乐玩耍使用,因为只用了不到一天时间完成的,所以很多地方没有优化,试用中有什么意见在下面评论里留言
使用前需要安装
Microsoft .NET Framework 4.0.30319.1
下载地址:
软件使用截图:
程序源代码:
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
using NetDimension.W
using System.T
using System.IO;
namespace sinaWeibo
& & public partial class
Form1 : Form
& private LoginForm
& private dynamic userM
& private T
& public Form1()
InitializeComponent();
& & & loginFrom
= new LoginForm();
& & & weibo =
new Tool();
userMessage = weibo.GetUserMessage();
TextBox.CheckForIllegalCrossThreadCalls =
& private void button1_Click(object sender,
EventArgs e)
weibo.sendWeibo(txtWeibo.Text);
txtWeibo.Text = "";
txtAppLog.AppendText("发送微博成功!!!\r\n");
& private void Form1_Load(object sender, EventArgs
picboxHead.ImageLocation = userMessage.profile_image_
labFansNum.Text = "粉丝:"+userMessage.followers_
labSeeNum.Text = "关注:"+userMessage.friends_
labAddress.Text = "所在地:" + userMessage.
labClientName.Text = "你正在使用的是:
"+Properties.Settings.Default.ClientN
&weibo.HasDenglu();
& Thread threadPublic =
& private void btnSayPublic_Click(object sender,
EventArgs e)
pingNum = int.Parse(txtSayNum.Text);
threadPublic = new Thread(() =&
& while (pingNum &= 0)
& & & string
userName = weibo.SayPublicWeibo(this.txtWeibo.Text +
DateTime.Now.Second.ToString());
txtAppLog.AppendText( userName);
txtSayNum.Text = (pingNum--).ToString() ;
threadPublic.Join(500);
threadPublic.Start();
& private void Form1_FormClosing(object sender,
FormClosingEventArgs e)
& & & if (null
!= threadPublic)
& & threadPublic.Abort();
& & & if (null
!= threadFriend)
& & threadFriend.Abort();
& & & if (null
!= threadLoveOnline)
threadLoveOnline.Abort();
& & & if (null
!= ThDeleteFans)
& & ThDeleteFans.Abort();
& & & if (null
!= thSaveWeibo)
& & thSaveWeibo.Abort();
& private void btnStopSayPublic_Click(object
sender, EventArgs e)
threadPublic.Abort();
txtAppLog.AppendText("已经停止评论最新微博!");
& Thread threadFriend =
& private void btnSayFriendWeibo_Click(object
sender, EventArgs e)
pingNum = int.Parse(txtSayFriendNum.Text);
threadFriend = new Thread(() =&
& & if (pingNum &=
& string userName =
weibo.SayFriendWeibo(this.txtWeibo.Text +
DateTime.Now.Second.ToString(),pingNum);
& txtAppLog.AppendText(userName);
& threadFriend.Join(500);
threadFriend.Start();
& private void btnStopSayFriendWeibo_Click(object
sender, EventArgs e)
threadFriend.Abort();
txtAppLog.AppendText("已经停止评论好友微博!");
& Thread threadLoveOnline=
& private void btnLoveOnline_Click(object sender,
EventArgs e)
pingNum = int.Parse(txtLoveNum.Text);
threadLoveOnline = new Thread(() =&
& & while (pingNum
& string userName = weibo.LoveOnline();
& txtAppLog.AppendText(userName);
& txtLoveNum.Text = (pingNum--).ToString();
& threadLoveOnline.Join(500);
threadLoveOnline.Start();
& private void btnStopLoveOnline_Click(object
sender, EventArgs e)
threadLoveOnline.Start();
txtAppLog.AppendText("已经停止关注!");
& Thread ThDeleteFans =
& private void btnDeleteRubishFans_Click(object
sender, EventArgs e)
& & & int num =
int.Parse(txtDeleteNum.Text);
ThDeleteFans = new Thread(() =&
txtAppLog.AppendText(weibo.DeleteRubishFans(num));
ThDeleteFans.Start();
& Thread thSaveWeibo =
& private void btnSavaWeibo_Click(object sender,
EventArgs e)
& & &// var
allWeiboNum = weibo.GetUserMessage().statuses_
& & & bool
isHasTime = chkSendTime.C
&allWeiboNum =
int.Parse(userMessage.statuses_count);
saveWeiboNum = 0;
(allWeiboNum & 100
&& allWeiboNum &
& & saveWeiboNum =
& & & else
& & if (allWeiboNum
& saveWeiboNum = 100;
& if (0 == allWeiboNum)
MessageBox.Show("没有微博保存个啥啊","孩子",MessageBoxButtons.OK,MessageBoxIcon.Error);
(DialogResult.OK == sfdSavaWeibo.ShowDialog())
& & thSaveWeibo = new Thread(()
& & & string
savaPath = sfdSavaWeibo.FileN
& & & FileStream
fs = new FileStream(savaPath, FileMode.Create);
& & & string
weiboStr = weibo.SavaWeibo(saveWeiboNum, isHasTime);
& & & byte[]
bytes = Encoding.UTF8.GetBytes(weiboStr);
fs.Write(bytes, 0, bytes.Length);
& & thSaveWeibo.Start();
MessageBox.Show(allWeiboNum.ToString()+"条微博");
& private void linkLabel1_LinkClicked(object
sender, LinkLabelLinkClickedEventArgs e)
System.Diagnostics.Process.Start("/wsxhf");
& private void groupBox4_Enter(object sender,
EventArgs e)
& private void groupBox2_Enter(object sender,
EventArgs e)
& private void txtAppLog_TextChanged(object
sender, EventArgs e)
using System.Collections.G
using System.D
using System.D
using System.L
using System.T
using System.Windows.F
namespace sinaWeibo
& & public partial class
LoginForm : Form
& private int loginTime = 0;
& public &ClientSet clientSet =
new ClientSet();
&Dictionary&string,
AppSetWeibo& app = new
Dictionary&string,
AppSetWeibo&();
& public LoginForm()
InitializeComponent();
& private void LoginForm_Load(object sender,
EventArgs e)
& & & AppSetAlls
appAll = new AppSetAlls();
app.Add("Acer平板电脑", appAll.Acer平板电脑);
app.Add("微博桌面", appAll.微博桌面);
app.Add("Spring微博", appAll.Spring微博);
app.Add("Panda", appAll.Panda);
app.Add("iphone客户端", appAll.iphone客户端);
app.Add("app梦工厂微博", appAll.app梦工厂微博);
app.Add("FIT随享iPhone版", appAll.FIT随享iPhone版);
app.Add("iPhone微博助手", appAll.iPhone微博助手);
app.Add("WeicoAndroid版", appAll.WeicoAndroid版);
app.Add("WeicoiPhone版", appAll.WeicoiPhone版);
app.Add("联想乐Pad客户端", appAll.联想乐Pad客户端);
app.Add("摩托罗拉XOOM", appAll.摩托罗拉XOOM);
app.Add("三星GalaxyS", appAll.三星GalaxyS);
& & & foreach
(var item in app)
combSinaSet.Items.Add(item.Key);
combSinaSet.SelectedItem = "Spring微博";
& private class AppSetAlls
& & & public
AppSetWeibo Spring微博 { }
& & & public
AppSetWeibo 微博桌面 { }
& & & public
AppSetWeibo Acer平板电脑 { }
& & & public
AppSetWeibo Panda { }
& & & public
AppSetWeibo iphone客户端 { }
& & & public
AppSetWeibo app梦工厂微博 { }
& & & public
AppSetWeibo FIT随享iPhone版 { }
& & & public
AppSetWeibo iPhone微博助手 { }
& & & public
AppSetWeibo WeicoAndroid版 { }
& & & public
AppSetWeibo & WeicoiPhone版 { }
& & & public
AppSetWeibo 联想乐Pad客户端 { }
& & & public
AppSetWeibo 摩托罗拉XOOM { }
& & & public
AppSetWeibo 三星GalaxyS { }
& & & public
AppSetAlls()
& & Spring微博 = new
AppSetWeibo("",
"36b51c6ebf2dd3ec4506267");
& & 微博桌面 = new
AppSetWeibo("", "");
& & Panda = new
AppSetWeibo("", "6a7c98c1eefa08199a35bef");
& & Acer平板电脑 = new
AppSetWeibo("", "7f63ae9eb3c2748ca8a341");
& & iphone客户端 = new
AppSetWeibo("",
"5Jao51NF1i5PDC91hhI3ID86ucoDtn4C");
& & app梦工厂微博 = new
AppSetWeibo("", "bbd573c3052999adcd026cbf88ffbf8e");
& & FIT随享iPhone版 = new
AppSetWeibo("", "25c3e6be5b280884b45c51f");
& & iPhone微博助手 = new
AppSetWeibo("", "82d9b7cde0711a20f146fa44");//s60
= new AppSetWeibo("s60", "AbLmkn77N8j72iyE2Aup5RoRN8C0M3E5");
& & WeicoAndroid版 = new
AppSetWeibo("", "63b64d531b98c2dbff2443816f274dd3");
& & WeicoiPhone版 = new
AppSetWeibo("", "72da6f329c4f2b1e949e6a");
& & 联想乐Pad客户端 = new
AppSetWeibo("",
"70dc2aec9c533092171dd");
& & 摩托罗拉XOOM = new
AppSetWeibo("",
"ebf566b74220768014afd");
& & 三星GalaxyS = new
AppSetWeibo("",
"ebf566b74220768014afd");
& & WeicoiPhone版 = new
AppSetWeibo("",
"07b27d2c098eda5eec681abdde832a51");
& private class AppSetWeibo
& & & public
string AppKey { }
& & & public
string AppSecret { }
& & & public
AppSetWeibo()
& & & public
AppSetWeibo(string appKey,string appSecret)
& & AppKey = appK
& & AppSecret = appS
& private void LoginForm_FormClosed(object sender,
FormClosedEventArgs e)
Properties.Settings.Default.Save();&
& private void btnLogin_Click(object sender,
EventArgs e)
clientSet.AppKey =
app[combSinaSet.SelectedItem.ToString()].AppK
clientSet.AppSecrect =
app[combSinaSet.SelectedItem.ToString()].AppS
clientSet.UserName = txtUserName.Text.Trim();
clientSet.UserPsw = txtPsw.Text.Trim();
(clientSet.Authorize())
Properties.Settings.Default.ClientName =
combSinaSet.SelectedItem.ToString();
& &this.DialogResult =
DialogResult.OK;
& & & else
MessageBox.Show("用户名或密码错误,请重新登录","温馨提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
& & if (3 &
loginTime++)
MessageBox.Show("孩子啊,都登这么多次了怎么还登啊,找找密码去吧","唉",MessageBoxButtons.OK,MessageBoxIcon.Warning);
& this.DialogResult = DialogResult.No;
& private void LoginForm_FormClosing(object
sender, FormClosingEventArgs e)
Properties.Settings.Default.Save();&
& private void button2_Click(object sender,
EventArgs e)
this.DialogResult = DialogResult.No;
using System.Collections.G
using System.L
using System.T
using NetDimension.W
using System.T
using System.Windows.F
namespace sinaWeibo
& & class Tool
& private Client S
& public Tool()
& & & OAuth
oauth = new OAuth(Properties.Settings.Default.AppKey,
Properties.Settings.Default.AppSecret,
Properties.Settings.Default.AppTaken, null);
& & & Sina = new
Client(oauth);
this.Sina.API.Entity.Account.GetUID();
& & & catch
(Exception )
& /// 发送微博
&/summary&
& /// &param
name="weibo"&&/param&
& public void sendWeibo(string weibo)
statusInfo = Sina.API.Entity.Statuses.Update(weibo);
& /// 获取用户信息
&/summary&
&returns&用户的全部信息字段&/returns&
& public object GetUserMessage()
userMessage = Sina.API.Dynamic.Users.Show(uid);
& & & return
& //评论公共微博
& public string SayPublicWeibo(string str)
& & & string
useName = "";
& & & var json =
Sina.API.Entity.Statuses.PublicTimeline(count: 1);
(json.Statuses != null)
& & foreach (var status in
json.Statuses)
& string id = status.ID;
& useName = status.User.ScreenN
Sina.ments.Create(id, str);
& catch (Exception e)
& & & return
e.Message + "\r\n";
& & & return
"已经评论了@" + useName + "的微博\r\n";
& /// 评论好友微博
&/summary&
& /// &param
name="str"&&/param&
&returns&评论的微博博主昵称&/returns&
& public string SayFriendWeibo(string str,int
& & & string
useName = "";
StringBuilder sb = new StringBuilder();
& & & var json =
Sina.API.Entity.Statuses.FriendsTimeline(count: num);
(json.Statuses != null)
& & foreach (var status in
json.Statuses)
& string id = status.ID;
& useName = status.User.ScreenN
Sina.ments.Create(id, str);
sb.AppendLine("已经评论了@" + useName + "的微博");
& catch (Exception e)
& & & return
e.Message + "\r\n";
& & & return
sb.ToString();
& /// 自动关注微博
&/summary&
&returns&关注的微博博主&/returns&
& public string LoveOnline()
& & & string
useName = "";
& & & var json =
Sina.API.Entity.Statuses.PublicTimeline(count: 1);
(json.Statuses != null)
& & foreach (var status in
json.Statuses)
& useName = status.User.ScreenN
Sina.API.Dynamic.Friendships.Create("", useName);
& catch (Exception e)
& & & return
e.Message + "\r\n";
& & & return
"已经关注了@" + useName + "\r\n";
& /// 去除关注
&/summary&
& /// &param
name="num"&&/param&
&returns&&/returns&
& public string DeleteRubishFans(int num)
& & & var json =
Sina.API.Entity.Friendships.Followers(uid, "", 1);
& & & int fanNum
StringBuilder sb = new StringBuilder();
& & & while
(fanNum &= 0)
& & fanNum--;
& json = Sina.API.Entity.Friendships.Friends(uid,
& & catch (Exception)
& & if (null != json)
& foreach (var ststus in json.Users)
Sina.API.Entity.Friendships.Destroy(ststus.ID);
& & sb.Append("已经取消对@" +
ststus.ScreenName + "的关注\r\n");
& & & catch
(Exception ex)
& & sb.Append(ex.Message);
& & & return
sb.ToString();
& public string SavaWeibo(int num, bool
isHasTime)
StringBuilder sbWeibo = new StringBuilder();
& & var status =
Sina.API.Entity.Statuses.UserTimeline(count: num);
& & foreach (var item in
status.Statuses)
& sbWeibo.AppendLine(item.Text);
& sbWeibo.AppendLine();
& if (isHasTime)
& & & string
time = item.CreatedAt;
sbWeibo.AppendLine("发布时间:" + time.Substring(0, 19));
sbWeibo.AppendLine();
& sbWeibo.AppendLine();
& sbWeibo.AppendLine();
& & return
sbWeibo.ToString();
& & & catch
(Exception ex)
sbWeibo.Append(ex.Message);
& & return
sbWeibo.ToString();
& public string
&HasDenglu()
& & & return
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。}

我要回帖

更多关于 iphone null 无法删除 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信