Take screenshots in game?

I want to have a button on the canvas that when clicked, it takes a screenshot (I guess it would be the main camera in this case), and saves it to the desk top (with a name like sreenshot1, screenshot2, etc etc. Does anyone have code for this or can explain how I could write it? Thanks!

Use this class.