Results 1 to 5 of 5

Thread: [RESOLVED] Settings and power troubles

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2008
    Location
    PA
    Posts
    365

    Resolved [RESOLVED] Settings and power troubles

    I have been using this code for a while now on my development machine and it worked all the time. Now, my test machine is a laptop without a battery. When the laptop loses power and shuts down immediately, the next time it turns back on just fine but my program starts having issues while loading.
    Spare the, this isn't safe for the laptop, I know, but it's all I can do until I mod the power button.
    Anyways, the program acts like the settings were never there, never initialized, never contained properties, nothing. I added the try/catch block and every time I start the program it always enters the catch block.
    I am saving all the settings for the program every 15 seconds, but not closing the program is causing major problems. Is there anyway around this, or am I sol?

    Code:
    Try
                If My.Settings.firstresolution = "" Or My.Settings.firstresolution Is Nothing Then
                    My.Settings.firstresolution = "800x480"
                    resolution = "800x480"
                Else
                    resolution = My.Settings.firstresolution
                End If
            Catch
            End Try
    
    Try
                If My.Settings.SkinFolder Is Nothing Or My.Settings.SkinFolder = "" Then
                    My.Settings.SkinFolder = resolution & "\Default"
                    Form1.skinfolder = resolution & "\Default"
                Else
                    Form1.skinfolder = My.Settings.SkinFolder
                End If
            Catch
            End Try
    Last edited by detlion1643; Nov 15th, 2010 at 03:25 PM. Reason: Fixed code blocks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width