Hi,
how to use LocalStorage in vbnet (wisej 2)
Application.Browser.LocalStorage.GetValue(keyname, ???)
regards
Cristian
Hi Cristian,
It would be something like this:
Private Sub Button1_Click() Application.Browser.LocalStorage.GetValue(Of String)("test", AddressOf ShowKeyValue) End Sub Private Sub ShowKeyValue(value As String) AlertBox.Show("Key Value was " + value) End Sub
OR
Private Sub Button1_Click() Application.Browser.LocalStorage.GetValue(Of String)("test", (Sub(val As String) AlertBox.Show("Key Value was" + val) End Sub)) End Sub
OR
Private Async Sub GetValueAsync() Dim value as new Integer value = Await Application.Browser.LocalStorage.GetValueAsync(Of Integer)("test") ShowKeyValue(value) End Sub
A few things:
Let me know if you have any other questions!
Best,
Levie
Hi Levie,
your code work perfectly.
but if I want to insert the value in a variable to be used immediately, isn’t it possible?
samething like
Dim pippo as string
Application.Browser.LocalStorage.GetValue(Of String)("test", (Sub(val As String)
pippo = val)
End Sub))
MessageBox.Show(pippo)
pippo in the messagebox is empty