-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