Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hi, yet again I have a problem,
Im using VB 2008.
Im making an internet tool suite, kind of like net tools, but just a small little set, the thing is, I need it to be activated before someone can use it.this is what i have :
Private Sub open_button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles open_button.Click
If Not TextBox1.Text = "403596383" And TextBox2.Text = "324589bs983a983f9823" Then
Dim isolatedStore As IsolatedStorageFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly, Nothing, Nothing)
Dim isoStream As New IsolatedStorageFileStream("act_status.bin", FileMode.OpenOrCreate, FileAccess.Write, isolatedStore)Using writer As New StreamWriter(isoStream)
writer.WriteLine("Activated=No")
End Using
End If
If TextBox1.Text = "403596383" And TextBox2.Text = "324589bs983a983f9823" Then
Dim isolatedStore As IsolatedStorageFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User Or IsolatedStorageScope.Assembly, Nothing, Nothing)
Dim isoStream As New IsolatedStorageFileStream("act_status.bin", FileMode.OpenOrCreate, FileAccess.Write, isolatedStore)Using writer As New StreamWriter(isoStream)
writer.WriteLine("Activated=Yes")
End Using
If TextBox3.Text = "Activated=Yes" Then
Form1.Show()
Me.Hide()
End If
End If
End Sub
---------
I need to know how to make the isolated storage file change only when the infomation is correct, and make it stay like that, not showing the login form on next startup..
If i have to i will send the program via email, but i would like to get the best help here before i go to anything that drastic.
thanks.Curiousity only injured the cat.
I finished it off..
Muahahaha...

Ah, what the heck. General answers for general questions:
I need to know how to make the isolated storage file change only when the infomation is correct
Easy enough; just don't write anything to it unless you want to. Simple.and make it stay like that, not showing the login form on next startup
Then you need to decide how you want your objects to play out. Personally, I'd merge my activation object with my activation form. I'd also expose only one public element, be it a read-only property IsActivated or a function Activate() As Boolean. This property/function would handle the file reading, and making the activation form visible if required.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |