Encrypting richtextbox before saving

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • latitude
    New Member
    • Nov 2006
    • 50

    Encrypting richtextbox before saving

    I have this little code:

    Code:
    private void notePage1_KeyUp(object sender, KeyEventArgs e)
    		{
    			notePage1.SaveFile(Application.StartupPath +@"\fxNotesText1.Rtf");
    	   }
    Need to know if there would be an easy way to encrypt the text from the richtextbox called notepage1 before it saves? Would also be good if it did it when exiting the application, like:
    Code:
     File.Encrypt(Application.StartupPath + @"\fxNotesText1.Rtf");
    Tried this but doesnt seem to work...
Working...