/// <summary> /// Add one Twitter depends on the WeiBeeType and PictureFile /// </summary> /// <returns>wei bo id</returns> public string Add() { if (string.IsNullOrEmpty(Token) || string.IsNullOrEmpty(TokenSecret)) { return(string.Empty); } IWeiBee wb = WeiBeeFactory.CreateWeiBeeByType(WbType); wb.SetOAuth(Token, TokenSecret); string ret; if (PictureFileStream != null) { ret = wb.AddPicture(MessageText, PictureFileStream); } else if (string.IsNullOrEmpty(PictureFile)) { ret = wb.AddTwitter(MessageText); } else { ret = wb.AddPicture(MessageText, PictureFile); } return(ret); }
private void InitWeiBeeAdd(IWeiBee wb, string txt) { Token = wb.GetOAuth().Token; TokenSecret = wb.GetOAuth().TokenSecret; WbType = wb.UserType; MessageText = txt; ScheduledTime = DateTime.UtcNow; }
void OpenAuthPage() { IWeiBee weibee = WeiBeeFactory.CreateWeiBeeByType(WeiBeeType.QQ); weibee.GetOAuth().SetCallbackUrl(callbackurl); string authenticationUrl = weibee.GetOAuth().AuthorizationLinkGet(); Session[TokenSessionName] = weibee.GetOAuth().Token; Session[TokenSecretSessionName] = weibee.GetOAuth().TokenSecret; Session["weibeetype"] = weibee.UserType.ToString(); Response.Redirect(authenticationUrl); }
public WeiBeeAdd(IWeiBee wb, string txt, string pic) { PictureFile = pic; InitWeiBeeAdd(wb, txt); }
public WeiBeeAdd(IWeiBee wb, string txt) { InitWeiBeeAdd(wb, txt); }