![Actor in C# Example avatar](https://images.apifyusercontent.com/OL8AZx7LpnvMZPHbwJAOWkw1jHuPZBxvyu7QPDkxJhw/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9IOW02QmVSc0Z4MTZBNkZZcy94ejJwRXJxcXhSaEt4bXBHVC1DX1NoYXJwX3dvcmRtYXJrLnBuZw.webp)
Actor in C# Example
DeprecatedView all Actors![Actor in C# Example](https://images.apifyusercontent.com/OL8AZx7LpnvMZPHbwJAOWkw1jHuPZBxvyu7QPDkxJhw/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9IOW02QmVSc0Z4MTZBNkZZcy94ejJwRXJxcXhSaEt4bXBHVC1DX1NoYXJwX3dvcmRtYXJrLnBuZw.webp)
This Actor is deprecated
This Actor is unavailable because the developer has decided to deprecate it. Would you like to try a similar Actor instead?
See alternative Actors![Actor in C# Example](https://images.apifyusercontent.com/OL8AZx7LpnvMZPHbwJAOWkw1jHuPZBxvyu7QPDkxJhw/rs:fill:92:92/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS9IOW02QmVSc0Z4MTZBNkZZcy94ejJwRXJxcXhSaEt4bXBHVC1DX1NoYXJwX3dvcmRtYXJrLnBuZw.webp)
Actor in C# Example
patrik.trefil/c-sharp-apify-actor-example
Example actor built in C# programming language. Downloads HTML from any page. Works on Apify platform and locally.
Example Apify actor in C#
Minimal example for developing Apify actor in C# programming language. Here is the actor's page on the Apify store. The code is open source.
The example:
- Reads user provided URL from input
- Does HTTP request to get HTML from this URL
- Saves HTML into OUTPUT record in Key Value Store
This actor works both on Apify platform and locally.
Local usage
For local usage, you need to:
- Clone the repository
- Install dotnet
- Create local storage with
apify init
or manually create folder pathapify_storage/key_value_stores/default/
- Add
INPUT.json
file input inside this path that looks like this:
1{ 2 "url": "https://apify.com" 3}
- Build and run the solution with
dotnet run
- You can find
OUTPUT.html
next toINPUT.json
Developer
Maintained by Community
Categories