Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Saving a New Note - Day 4 - Part 8

Embed code for this video

Copy the code above to embed our video on your website/blog.

Close

Video format

Option selected may change based on video formats available and browser capability.

Close

Download

Right click “Save as…”

Now that we have all the parts we need, it's time to construct the file name and save the file's text. Then, we’ll navigate back to the MainPage.xaml and see the new note in the ListBox.

Download the source code in c#

Download the source code in VB.Net

Follow the Discussion

  • Very laborious use of the string builder. This would do it more easily.  

    DateTime.Now.ToString("yyyy_MM_dd_hh_mm")

     

  • Great! The StringBuilder is very useful and easy... thanks

  • Golnazgolnazal HEY HEY HEY

    opening thread

  • vijay sharmavijay sharma

    Hi
    How can we get the last write date time of each note.

  • @vijay sharma: You should be able to use DateTime.Now, and then format it the way you want.  This resource should help you decide how you want to format the DateTime.Now that you'll ultimately want to use as the filename:

    http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

    Is that what you're looking for?  Right direction?  Good luck!

  • Vijay SharmaVijay Sharma

    Hi Bob,
    Thanks for your reply. But I am interested in getting the last write date time of each file, exactly the way we are getting filename of each file inside for each loop.

    Please Help...
    -------------------------------------------------------------
    private void bindList()
    {
    var appStorage = IsolatedStorageFile.GetUserStoreForApplication();

    string[] fileList = appStorage.GetFileNames();

    List<Note> notes = new List<Note>();

    foreach (string file in fileList)
    {
    // Retrieve the file
    string fileName = file;
    // How to Retrieve the Last write time of each file ????


    notes.Add(new Note() { Location = location, DateCreated = dateCreated.ToLongDateString() });
    }

    noteListBox.ItemsSource = notes;
    }

Remove this comment

Remove this thread

close

Comment on the Post

Already have a Channel 9 account? Please sign in