Support Forums
Check If Executed For First Time. (Simple) - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: Check If Executed For First Time. (Simple) (/showthread.php?tid=11231)



Check If Executed For First Time. (Simple) - wchar_t - 08-13-2010

Code:
Public Shared Function IsFirstRun() As [String]
        Dim oWrite As System.IO.StreamWriter
        If Not File.Exists(Application.StartupPath & "\\firstrun.txt") Then
            oWrite = File.CreateText(Application.StartupPath & "\\firstrun.txt")
            IsFirstRun = "First Time Ran"
        Else
            IsFirstRun = "Already Ran."
        End If
    End Function

@ Eve NO.


RE: Check If Executed For First Time. (Simple) - mmki - 08-18-2010

There is heaps ways to do this. But this is a good way of doing it Smile I justtest using a .ini file or something instead. Just looks more offical. But its great never the less Smile


RE: Check If Executed For First Time. (Simple) - .Nielz - 08-19-2010

A way I haven't seen that much but works also . Nice stuff .


RE: Check If Executed For First Time. (Simple) - Buzz Lightyear - 08-19-2010

Nice. This is great to do. Great work!