New topic: Problem creating a file in W vista e seven
<http://forums.realsoftware.com/viewtopic.php?t=34211> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message janluk Post subject: Problem creating a file in W vista e sevenPosted: Thu Jun 10, 2010 5:28 am Joined: Sun Jan 17, 2010 4:06 pm Posts: 10 Location: Italy Hi All, have a problem. I wrote this code to create a file in a directory of my choice. Works well on xp but will not work on Windows Vista (32bit) and Windows 7 (32bit). Shows the error message: An exception of IOException was not handled. The application must shut down. Exception Error Number: 5 Dim f As FolderItem = SpecialFolder.windows.Child ("SmpS.txt") Dim t As TextOutputStream f= SpecialFolder.windows.Child ("SmpS.txt") t=TextOutputStream.Create(f) t.WriteLine Str(app.LongVersion) t.WriteLine "try1" t.WriteLine "Try2" t.Close How can I fix this, where am I wrong? Thanks for the reply. Top jharris Post subject: Re: Problem creating a file in W vista e sevenPosted: Thu Jun 10, 2010 6:45 am Joined: Wed Aug 05, 2009 6:32 am Posts: 21 Location: Mountain Home, AR I don't think Vista or Windows 7 will let you create or modify files in the system folders. You will be better off to create a folder in the users AppData folder and use it to store the files for your application. f = SpecialFolder.Preferences.Child("FolderName").Child("SmpS.txt") or f = SpecialFolder.ApplicationData.Child("FolderName").Child("SmpS.txt") _________________ RB Pro 2010R2 Windows 7/Ubuntu 9.04 I am interested in plugins as a solution. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
