Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7819627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:01:22+00:00 2026-06-02T07:01:22+00:00

Ok so I am 100% new to sharing things from C# on facebook. I

  • 0

Ok so I am 100% new to sharing things from C# on facebook.

I need a sample code of how to share an Image on my facebook as a photo ?

Please do NOT answer with ( Google it, I dnt know, why ?, impossible, Facebook SDK )…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:01:25+00:00Added an answer on June 2, 2026 at 7:01 am

    Your question is a bit vague. When you say “in C#”, you mean in a web, a window, or a service environment? Because the way Facebook does it is that there has to be some authentication in the process, and that is achieved via redirecting to Facebook for a user to login, and THEN send the photo for sharing. It’s quite a process, not just a one-line code that does magic.

    In any case, you have to do the following, and you have to figure out where you place it in your environment:

    1. Create a Facebook app that corresponds to your app; Facebook will then give you an app code, and an app secret code.
    2. Using the app code, redirect to Facebook to authenticate the user who wants the photo shared on their Facebook.
    3. Receive back a code from Facebook.
    4. Authorize your app by communicating to Facebook via a service call to allow photo sharing using the app code, the app secret code, and the code we got from step 2.
    5. Receive back a token from Facebook that will be used from now on to upload photos.
    6. NOW you can start uploading the photo via another service call to Facebook using that token.

    Here’s the code:

    // Step 2: you have to research what TheScope will be from Facebook API that gives you access to photos
    Response.Redirect(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&scope={1}&redirect_uri={2}"), MyAppCode, TheScope, MyRedirectingURL);
    
    // Step 3: this is on the `Page_Load` of MyRedirectingURL.
    // AnotherRedirectingURL will be your final destination on your app
    using (var wc = new WebClient())
    {
        string token = wc.DownloadString(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&code={2}&redirect_uri={3}", MyAppCode, MyAppSecretCode, TheCode, AnotherRedirectingURL));   
    }
    
    // Step 4:  Use the token to start stream up or down
    using (var wc = new WebClient())
    {    
        Uri uploadUri = new Uri(string.Format("https://graph.facebook.com/{0}?{1}", PhotoUploadCommand, token));     
    
        // Find out what the PhotoUploadCommand is supposed to be from the Facebook API
        // use wc and uploadUri to upload the photo
    }
    

    Bottom line, you have to do your research on this… it’s not that straightforward. It’s the sad truth that I had to go through to do what you’re doing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to wrap a dynamically allocated array(from a = new double[100] for example)
I have the following two lines of code: var BadResult = (100).ToString(B, new CustomFormatter
Here is my code: <%= Html.TextArea(txtMyTextArea, new { @style = width: 100%; height:100%, @resize=horizontal
I really need some help with this. I'm 100% new to it. I need
I am not totally new to PHP or XML but I am 100% new
I have the following code; void* buffer = operator new(100); unsigned char* etherhead =
Preface: I am 100% new to the Flash and ActionScript world, doing research for
h = Hash.new (1..100).each { |v| h.store(v * 2, v*v) } What is the
I create array: TextBox[] textarray = new TextBox[100]; Then in cycle set this params,
So at the moment I have a multidimensional array string[,] items = new string[100,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.