Upload file to SharePoint: The remote server returned an error: (401) Unauthorized

Hello All,

I am trying to upload file on sharepoint using ID which have full rights on sharepoint. but i am getting below error

Upload file to SharePoint: The remote server returned an error: (401) Unauthorized.
Can any body help me out for the same.

Properties
File to Upload - “C:\SupplyChainPRdata\temp.txt”
Library path = “Lib name of sharepoint”
password = “password”
username =“username”
Site url = “URL of site”

Thanks & Regards,
Priyanka