locked
Datetime Please help RRS feed

  • Question

  •         }
    
            private void AppBar_Add_Click(object sender, EventArgs e)
            {
                string fileName = "2010_10_06_13_43_Oklahomacity_Oklahoma-USA.TXT";
                string fileContent = "dustin ist the shit";
    
                var appStorage = IsolatedStorageFile.GetUserStoreForApplication();
                if (appStorage.FileExists(fileName))
                {
                    using (var file = appStorage.CreateFile(fileName))
                    {
                        using (var writer = new StreamWriter(file))
                        {
                            writer.WriteLine(fileContent);
                        }
                    }
                }
            }
    
            private void BindList()
            {
                var appStorage = IsolatedStorageFile.GetUserStoreForApplication();
                string[] fileList = appStorage.GetFileNames();
    
                List<note> notes = new List<note>();
    
                
                foreach (string file in fileList)
                {
                    // get the file
                    string fileName = file;
                    //get date
                    string year = file.Substring(0, 4);
                    string month = file.Substring(5, 2);
                    string day = file.Substring(8, 2);
                    string hour = file.Substring(11, 2);
                    string minute = file.Substring(14, 2);
    
    
                    DateTime dateCreated = new DateTime(int.Parse(year), int.Parse(month), int.Parse(day), int.Parse(hour), int.Parse(minute)());
    
    
                    string location = file.Substring(20);
                    location = location.Replace("_", ",");
                    location = location.Replace("-", " ");
                    location = location.Substring(0, location.Length - 4);
    
                    notes.Add(new note() { Location = location, DateCreated = dateCreated.ToLongDateString() });
                }
                
    
                noteListBox.ItemsSource = notes;
            }
        }
        
    }

    DateTime dateCreated = new DateTime(int.Parse(year), int.Parse(month),

    int.Parse(day), int.Parse(hour), int.Parse(minute)());

    I keep getting an error "Method Name Expected" what did I do wrong?


    Dustin

    • Moved by Vicky SongMicrosoft employee Wednesday, May 23, 2012 4:30 AM (From:Visual Studio Database Development Tools (Formerly "Database Edition Forum"))
    Monday, May 14, 2012 8:43 AM

Answers

All replies