-1
我是新来的Visual Basic。有人可以解释我如何创建一个可视化的基本字符串。这是在注册表中的路径中包含我不喜欢它删除注册表字符串中的字
程序文件\ GTA圣安地列斯\ gta_sa.exe
的一部分,我想使它像
程序文件\ GTA圣安地列斯
没有gta_sa.exe
我试过
Dim readValue As Object
Dim dobijeno As String
Dim playerName As Object
readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\SAMP", "gta_sa_exe", Nothing)
dobijeno = readValue
Dim withoutParts As String = Replace(dobijeno, "\gta_sa.exe", "")
TextBox2.Text = readValue
playerName = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\SAMP", "PlayerName", Nothing)
TextBox1.Text = playerName
但它不起作用
你还没有真正解释你决定什么应该删除。如果你想删除最后一个“\”及其后的所有内容,最简单的方法是使用@AlastairBrown建议的'IO.Path.GetDirectoryName'来评论他的答案。另外,你应该阅读他的答案。 – Blackwood
[Sock puppet/dupe account](http://stackoverflow.com/users/6393100/nathaniel)阅读[Ask]并参加[Tour],也许你的帐户不会被限制/ Q禁止 – Plutonix