Dear friends,
I have a problem that I don't know how to solve it. I want to load a text file's content (just one line) in to a textbox. I tried to do it many times with many ways, but I failed. This is my code:

VB Code:
  1. Dim readFile As New StreamReader(variable.dataPath & "\" & variable.monthView & variable.yearView & variable.MST & variable.Loai & variable.Method & ".txt")
  2.  
  3.  Dim temp As String
  4.         Try
  5.             temp = readFile.ReadLine
  6.             RefFrm.frmDoanhThuVATTNDN.txtDT11.Text = temp
  7.         Catch ex As Exception
  8.             MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  9.         End Try
  10.  
  11.         readFile.Close()


VB Code:
  1. 'this is a class, to make form DoanhThuVATTNDN globally
  2. Private Shared p_frmDoanhThuVATTNDN As frmDoanhThuVATTNDN
  3. Public Shared Property frmDoanhThuVATTNDN() As frmDoanhThuVATTNDN
  4.         Get
  5.             Return p_frmDoanhThuVATTNDN
  6.         End Get
  7.  
  8.         Set(ByVal Value As frmDoanhThuVATTNDN)
  9.             p_frmDoanhThuVATTNDN = Value
  10.         End Set
  11.  
  12.     End Property

Or

VB Code:
  1. Dim readFile As New StreamReader(variable.dataPath & "\" & variable.monthView & variable.yearView & variable.MST & variable.Loai & variable.Method & ".txt")
  2.  
  3.  Dim temp As String
  4. dim form as new frmDoanhThuVATTNDN
  5.         Try
  6.             temp = readFile.ReadLine
  7.             form.txtDT11.Text = temp
  8.         Catch ex As Exception
  9.             MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  10.         End Try
  11.  
  12.         readFile.Close()

Although it could load textfile content into the variable "temp" but I did not load into texbox.