Generate new password event

Is there way to do monthly generated password for robot. That robot would create new password and save it to the credentials. Was there also some tutorial of how to create robot events.
I found something like this but those libraries aren’t available in uiPath or i didn’t found them or maybe i just didn’t know how to use them. Membership.GeneratePassword(Int32, Int32) Method (System.Web.Security) | Microsoft Learn

I am trying to do the same thing. I will try the generate password method you provided.
But I am not sure why you need an event. You can create a robot and a schedule to do this monthly.
With 2018.1 version, Set Credential is an activity in the robot. With earlier versions, the robot will have to use Orchestrator API to set the new password.