Skip to content

Instantly share code, notes, and snippets.

@Kieranties
Created November 17, 2010 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kieranties/703880 to your computer and use it in GitHub Desktop.
Save Kieranties/703880 to your computer and use it in GitHub Desktop.
Using Sharpnote.net to connect to Simplenote and create some notes
var email = "user@example.com";
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