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

Creating the Note Naming Convention - Day 4 - Part 4

Download

Right click “Save as…”

In this video, Bob discusses the strategy of using the file name as a means of storing the date and time the note was created, along with the location of the note’s composition. This requires quite a bit of familiarity with String and DateTime classes and their methods for formatting and parsing through data.

Download the source code in c#

Download the source code in VB.Net

Follow the Discussion

  • Writing the code to parse the date / time from the file name at 15 mins was a bit painful, much easier with

    DateTime dateCreated = DateTime.ParseExact(file.Substring(0,16), "yyyy_MM_dd_HH_mm",System.Globalization.CultureInfo.InvariantCulture);

     

  • Hi,

    Great video!  One problem tho 

    string[] fileList = appStorage.GetFileNames();

    creates collection starting at [0].  Running debug/emulator, I cannot get location to display on Page_Load in [0].  So I have to run thru the loop once, then hit the Add_Button(+) on Mainpage then continue loop for location to display in [1]. Any reason [0] is reserved for anything?  Anybody else have same prob?

    Thanks,

    E. 

  • ELMDEVELMDEV

    Got it worked out.@ELMDEV:

  • I hate to write

    string

     

    location = file.Substring(19);

     It had to have a 19 instead of a 20, with 20 it cut off the R in Redmond, I dont know why cos i had everything else correct, and it picked up the date and time just right.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.