static void Main(string[] args)
        {
            PostingItem item = new PostingItem();

            item.Title       = "Captain Marvel";
            item.Description = "Captain Marvel Wallpaper";
            item.url         = @"D:\01Projects\FacebookPosting\FacebookPosting\thumb-350-824755.png";
            FacebookPosting posting = new FacebookPosting(item);


            var result = posting.UploadFaceBookBatch(posting);

            Console.Read();
        }
        public object UploadFaceBookBatch(FacebookPosting input)
        {
            try
            {
                var fb = new FacebookClient(input.FacebookToken);
                fb.AppId     = input.FacebookAppId;
                fb.AppSecret = input.FacebookAppSecret;
                List <FacebookBatchParameter> fbp = new List <FacebookBatchParameter>();

                int count = 0;
                foreach (var item in input.PostingItems)
                {
                    string extension = Path.GetExtension(item.url);
                    string FileName  = Path.GetFileName(item.url);

                    if (!string.IsNullOrEmpty(extension))
                    {
                        extension = extension.Replace(".", "");
                    }

                    var param = new FacebookBatchParameter(HttpMethod.Post, "/me/photos", new Dictionary <string, object> {
                        { "message", item.Title }, { "pic" + count, new FacebookMediaObject {
                                                         ContentType = "image/" + extension, FileName = FileName
                                                     }.SetValue(File.ReadAllBytes(item.url)) }
                    });
                    fbp.Add(param);
                    count++;
                }

                return(fb.BatchTaskAsync(fbp.ToArray()).Result);
            }
            catch (FacebookOAuthException ex)
            {
                Console.WriteLine(ex.Message);
                return(ex);
            }
            catch (FacebookApiException ex)
            {
                Console.WriteLine(ex.Message);
                return(ex);
            }
        }