I would like to have my variable in .txt file. I’ve never done it before (I mean putting variable in .txt file). What should my file consist?
And what should I put into my vb project, when I want to use If function.
ex. my variable name = dzien
value= 0
Private Sub zapisz_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zapisz.Click
Open "C:\Plik.txt" For Append As #1
If dzien = 0 Then
TextBlock1.txt += "dzien jest 0"
End IF
Does this function work if in .txt file there is my variable?
There are multiple ways to do this. For instance, you could store the value in a text file, a binary file, an XML file, an ini file, or a configuration file. The simplest option is to use the built-in settings framework. To do that, go to your project properties and click on the settings tab. Create a new setting called “DZien” and set the type to an integer. Then, in code, you can access and set the value in the config file like this:
Rather, if you want to store a single number in a text file, you could do it like this:
In your case, where you are writing a windows phone app, you could do it like this: