Created
November 17, 2010 19:18
-
-
Save Kieranties/703880 to your computer and use it in GitHub Desktop.
Using Sharpnote.net to connect to Simplenote and create some notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var email = "[email protected]"; | |
var password = "password"; | |
var repo = SharpnoteRepository<Note>.Instance; | |
if (repo.Connect(email, password)) | |
{ | |
//Create a new note | |
//Notes must have content to be saved | |
var note = new Note | |
{ | |
Content = "This is the content of my note" | |
}; | |
//Save the note. The call returns a fully populated note. | |
note = repo.Save(note); | |
//Output note properties | |
Console.WriteLine(note.Modified.ToString()); | |
Console.WriteLine(note.Created.ToString()); | |
//Create a note with a custom created date | |
var note2 = new Note | |
{ | |
Content = "This is the content of my second note", | |
Created = new DateTimeOffset(new DateTime(2000,1,1)) | |
}; | |
note2 = repo.Save(note2); | |
//Output note properties | |
Console.WriteLine(note2.Modified.ToString()); | |
Console.WriteLine(note2.Created.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment