1

Right now I'm trying to check if the pass is right when reading the file, but the problem is I have a "Pass:" String in front of the pass.

writeFile.WriteLine("Pass: " + Me.txtCPass.Text) ' pass
Me.txtPassword.Text = (GetLine(FILE_NAME, 2))

Not sure how I would just skip over the "Pass: " and just get right to the pass.

4

2 回答 2

2

假设 GetLine 返回一个字符串

Me.txtPassword.Text = GetLine(FILE_NAME, 2).Substring(6)

Substring 是字符串类的一个方法。它返回为其调用的字符串实例的一部分。您可以传递一个起始索引,该方法返回余数。
或者您也可以传递一个长度来强制该方法返回实例内的已定义部分

在 MSDN 上,您可以找到详细说明

于 2013-05-11T17:45:49.017 回答
0

Me.txtPassword.Text = GetLine(FILE_NAME, 2).Substring(6)

于 2013-05-11T17:45:23.387 回答