本文整理汇总了C#中Facebook.FacebookClient.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# FacebookClient.Delete方法的具体用法?C# FacebookClient.Delete怎么用?C# FacebookClient.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook.FacebookClient
的用法示例。
在下文中一共展示了FacebookClient.Delete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteAction
public void DeleteAction(string actionId)
{
if (!string.IsNullOrEmpty(actionId))
{
Task.Factory.StartNew(() =>
{
var client = new FacebookClient(AccessToken);
client.Delete(string.Format("{0}", actionId));
});
}
}
示例2: Delete
public static void Delete(string accessToken, string id)
{
try
{
var fb = new FacebookClient(accessToken);
var result = fb.Delete(id);
// Note: This json result is not the orginal json string as returned by Facebook.
Console.WriteLine("Json: {0}", result.ToString());
}
catch (FacebookApiException ex)
{
// Note: make sure to handle this exception.
throw;
}
}
示例3: LikeFBGroupPost
public string LikeFBGroupPost(string postid, string accesstoken, string Isliked)
{
string ret = "";
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
FacebookClient fb = new FacebookClient();
fb.AccessToken = accesstoken;
try
{
if (Isliked == "liked")
{
dynamic unlike = fb.Delete("v2.0/" + postid + "/likes", null);
ret = "unlike";
}
else
{
dynamic like = fb.Post("v2.0/" + postid + "/likes", null);
ret = "like";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
ret = "Somthing Went Wrong";
}
return ret;
}
示例4: FacebookLike
public string FacebookLike(String msgguid, String profileid, string msgid, string userid)
{
string ret = "";
Domain.Socioboard.Domain.FacebookAccount objFacebookAccount = objFacebookAccountRepository.getFacebookAccountDetailsById(profileid, Guid.Parse(userid));
FacebookClient fb = new FacebookClient();
fb.AccessToken = objFacebookAccount.AccessToken;
objFacebookMessage = objFacebookMessageRepository.GetFacebookUserWallPostDetails(Guid.Parse(msgguid));
if (objFacebookMessage.FbLike == "likes")
{
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
var s = fb.Post("v2.0/" + msgid + "/likes", null);
objFacebookMessage.FbLike = "unlike";
}
else
{
var s = fb.Delete(msgid + "/likes", null);
objFacebookMessage.FbLike = "likes";
}
objFacebookMessageRepository.updateFacebookMessage(objFacebookMessage);
return ret;
}
示例5: SendImageWithTag
private string SendImageWithTag(IProgress<string> progress, string filename, string inputText, List<string> uids, string albumID=null)
{
try
{
string coverImage = MyHelper.CopyFileTo(filename, FB_Image.BaseDirectory);
string messageFile = MyHelper.CopyFileTo(inputText, FB_Image.BaseDirectory);
//Encode
string encodeFile = JPHideEncode(Path.GetFileName(coverImage), Path.GetFileName(messageFile));
if (progress != null)
progress.Report("25|Uploading Picture");
if (encodeFile == null)
return null;
string id = Upload_Picture_Tag(Path.Combine(FB_Image.BaseDirectory, encodeFile), uids,albumID);
if (progress != null)
progress.Report("50|Checking ...");
string downloadFile = MyHelper.AppendFileName(Path.Combine(FB_Image.BaseDirectory, encodeFile), "_download");
if (!DownloadFB(id, ActiveUser.AccessToken, downloadFile, true))
return null;
//Decode
string outputText = MyHelper.AppendFileNameNoLimit(inputText, "_ouput");
if (outputText == null)
outputText = "output_test.txt";
outputText = JPSeekDecode(Path.GetFileName(downloadFile), outputText,null,true);
if (outputText == null)
return null;
outputText = Path.Combine(FB_Image.BaseDirectory, outputText);
//compare 2 file
if (progress != null)
progress.Report("100|Finish");
if (MyHelper.CompareOutputFile(inputText, outputText))
{
return id;
}
else
{
var fb = new FacebookClient(ActiveUser.AccessToken);
dynamic res = fb.Delete(id); // xóa ảnh
return null;
}
}
catch (Exception e)
{
Log(e);
return null;
}
}
示例6: SetFbLike
public static bool SetFbLike(string fBPostId, short rating, FacebookClient fbapp)
{
GraphCommand likeCall = null;
if (rating <= 0)
{
likeCall = new GraphCommand(
(likeCommand) => fbapp.Delete(likeCommand, null)
);
}
else if (rating > 0)
{
likeCall = new GraphCommand(
(likeCommand) => fbapp.Post(likeCommand, null)
);
}
return RunLikeGraphCommand(fBPostId, likeCall);
}
示例7: RemovePost
public static bool RemovePost(string fBPostId, FacebookClient fbapp)
{
string graphCmd = string.Format("/{0}", fBPostId);
var response = fbapp.Delete(graphCmd);
bool success;
if (bool.TryParse(response.ToString(), out success))
{
return success;
}
return false;
}
示例8: SendNoTestImageWithTag
public string SendNoTestImageWithTag(IProgress<string> progress, string filename, string inputText, string albumID,List<string> uids)
{
try
{
if (String.IsNullOrEmpty(ActiveUser.AccessToken))
return null;
//Reduce size ratio of picture
if (progress != null)
progress.Report("15|15|Preparing Image");
string coverImageFileName = MyHelper.CopyFileTo(filename, FB_Image.BaseDirectory);
coverImageFileName = ProcessUserImage(coverImageFileName);
string messageFile = MyHelper.CopyFileTo(inputText, FB_Image.BaseDirectory);
//Encode
if (progress != null)
progress.Report("50|Uploading Image");
string encodeFile = JPHideEncode(Path.GetFileName(coverImageFileName), Path.GetFileName(inputText));
if (string.IsNullOrEmpty(encodeFile))
{
return null;
}
string id = Upload_Picture_Tag(Path.Combine(FB_Image.BaseDirectory, encodeFile),uids ,albumID);
if (string.IsNullOrEmpty(id))
{
return null;
}
if (progress != null)
progress.Report("75|Checking");
string downloadFile = MyHelper.AppendFileName(Path.Combine(FB_Image.BaseDirectory, encodeFile), "_download");
if (!DownloadFB(id, ActiveUser.AccessToken, downloadFile, true))
return null;
//Decode
string outputText = MyHelper.AppendFileNameNoLimit(inputText, "_ouput");
if (outputText == null)
outputText = "output_test.txt";
outputText = JPSeekDecode(Path.GetFileName(downloadFile), outputText,null,true);
if (outputText == null)
return null;
outputText = Path.Combine(FB_Image.BaseDirectory, outputText);
//compare 2 file
if (progress != null)
progress.Report("100|Finish");
if (MyHelper.CompareOutputFile(inputText, outputText))
{
return coverImageFileName;
}
else
{
var fb = new FacebookClient(ActiveUser.AccessToken);
dynamic res = fb.Delete(id); // xóa ảnh
return null;
}
}
catch (Exception e)
{
Log(e);
return null;
}
}