Question

I am making a C# Web Form application and I want to use RedditSharp. https://github.com/SirCmpwn/RedditSharp

I've never used an API in C#, this would be my first time using something outside of the C# generics. Could someone help me understand how to import it to use it?

Était-ce utile?

La solution

  1. Create C# Web Forms project in Visual Studio
  2. Download RedditSharp code from Github
  3. Compile RedditSharp into DLL (build enclosed solution, grab DLL from the bin/release folder or wherever it builds to)
  4. Add a reference from your project to RedditSharp DLL
  5. Check examples at https://github.com/SirCmpwn/RedditSharp, add something like that to your code
  6. Don't forget to add "using RedditSharp;" to the top of your code file.

Autres conseils

Easiest thing to do in Visual Studio is to install the nuget package. Go to Tools...Nuget Package manager... Manage Packages for Solution. Search for RedditSharp, click install.

Now you can reference it from anywhere in your project by adding:

using RedditSharp;

This has the added benefit of Visual Studio alerting you to new updates anytime the official RedditSharp project is updated.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top