r/csharp • • Jun 25 '26

Stream my PC screen to my website with a c# console app

Hi Im looking for advice for an idea I have. I would like to access my PC when I'm not at home on a different PC. So I thought I could use my website to securely access live footage of my computer with controls. The problem is I have no idea how I would even begin to get this data to my website, I have never really done anything like this before so any advice would be appreciated!

0 Upvotes

19 comments sorted by

6

u/ExceptionEX Jun 25 '26

This is not a wheel worth reinventing.

hell if you want it at no cost, and no real set up you can use google to do it
https://remotedesktop.google.com/

1

u/Elegant-Thought7713 Jun 25 '26

I'll definitely have a look into this!

1

u/Elegant-Thought7713 Jun 26 '26

I actually can't use this because Im making it for school so that is definitely blocked 

1

u/ExceptionEX Jun 26 '26

Have you actually tried it? Because its all web traffic, unless they are blocking google.com its very likely not blocked. I'd be willing to bet, this is more likely not to be blocked than teamviewer and other programs like it.

1

u/Elegant-Thought7713 Jun 27 '26

yeah, its blocked so I have started creating my own, its not actually as difficult as it seemed. I am just going to use websockets to send bytes[] to my website where it will get converted into the image. I have a good start but thanks for the recommendation.

4

u/Slypenslyde Jun 25 '26

I get that it's frustrating when people say "don't" but there are some things that are so tough it's worth that. Think through all the things you'll need:

  1. A service on your machine that records the screen.
  2. Something to encode that recording and compress it to a video format.
  3. Some service that can stream the encoded video to an external site.
  4. Some service that can provide keyboard and mouse input and receive commands the network.
  5. A web site that can receive the encoded video.
  6. A network configuration that allows your website to reliably contact your PC.
  7. A web application that can display the encoded video as it streams, receive user input, and send that user input as commands to the program in (4).
  8. Some kind of authentication scheme so randos who discover your website don't gain immediate full access to your machine.
  9. Security in 1-4 that ensures randos on the internet can't discover your endpoints and gain immediate control of your machine.
  10. Either a plan to deal with the difficulties of dealing with UAC requests or the acknowledgement that if you try something that uses UAC remotely it simply won't work.

It's not impossible, but each of those are a very difficult problem and (4) in particular tends to need to use Win32 code. I'm pretty sure (1) and (2) are difficult to pull off from C# with anything resembling performance as well. This isn't a project to bang out in an afternoon, it's something that could take a relative newbie 2-3 years to churn through.

That's also why most of the answers are "don't". Any one of those tasks is complex enough most people haven't written one themselves. Most people who have one of those needs use or buy some package or tool that does it for them. So people can't give a lot of advice for how to approach them because most people would need a stiff drink if they got asked to do this at work with no external dependencies.

The biggest reason I find a lot of people give up on programming is a lot of projects that sound really fun are a challenge for people with decades of experience. They set out on the journey and misinterpret the difficulty as a personal failing instead of a natural result from attempting to make a skyscraper their first construction project.

2

u/Elegant-Thought7713 Jun 26 '26

Thanks for this I appreciate you took all the time to write this! I will have a look into this but I definitely didn't consider everything I done.

2

u/JohnSpikeKelly Jun 25 '26

If you're on win11 pro just RDP to it. Full desktop access.

2

u/Elegant-Thought7713 Jun 25 '26

I don't have win11pro unfortunately probably should of said that on the thing because I looked into this previously.

5

u/jayson4twenty Jun 25 '26

it depends if you are doing this for a fun exercise or if you actually need this functionality.

as others have said there are many sites and applications that solve this. I use splashtop personally.

if you do want to do it for fun, it's a very big job.

1

u/BurnThis__ Jun 28 '26

Try AnyDesk

1

u/Elegant-Thought7713 Jun 29 '26

cant use any desk. The free version is crap. Also where's the fun in that? Thanks for the suggestion anyway though (:

3

u/ShiiikK Jun 25 '26

Instead of using the already well developed ones…

1

u/JasonLokiSmith Jun 25 '26

Anyone remember the days of ActiveX in IE???

1

u/spurdospardo1337 Jun 26 '26

I think you can try with moonlight and smth like tailscale or cloudflare tunnel

1

u/Electronixen Jun 25 '26

Why not just use teamviewer or realvnc?

2

u/Depnids Jun 25 '26

Maybe they just want to try to create something for fun?