0

所以基本上我想要做的是单击一个按钮,这会将我的文本放入一个文本框并在其后添加 ?xml=1 。如果有人想帮助我完成整个事情,那么图像低于我想要它做的事情

这就是我的意思http://i.stack.imgur.com/2eatj.png

这是它的样子http://i.stack.imgur.com/aCoJ0.png但是每次我点击 ?xml=1 它都会添加到底部这并不重要我点击哪一行它只会将它添加到最后

我用于 ?xml=1 部分的是 TextBox1.Text &= "?xml=1" {Public Class Form1

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
    TextBox1.Text &= "?xml=1"
End Sub

结束类}

4

1 回答 1

1

您的表格不完整,需要各种信息来生成 Steam64Id 编号。

即,您将需要“Universe”、“AccountType”、“AccountInstance”,当然还有“Account Number”。

当您将组件值值放在一起时,您最终会得到 Steam64Id 编号。

您可以在下图中看到它是如何分解的。

Steam64Id 编号的细分

更多信息可以在 Steam 开发者页面上找到

https://developer.valvesoftware.com/wiki/SteamID

更新

如果您在其中输入帐号的文本框称为 txtSource,并且您输入的数字为 0123456789,并且在添加“?xml = 1”后要写入的文本框称为 txtDestination,则将其传输过来的代码是

txtDestination.text = txtSource.text & "?xml=1"

如果您想在添加 URL 的同时将其传输过来,那么它将是

txtDestination.text = "http://steamcommunity.com/ID/" & txtSource.text & "?xml=1"

或者

txtDestination.text = "http://steamcommunity.com/PROFILES/" & txtSource.text & "?xml=1"

仍然存在一些未解决的问题,因为您尚未澄清它是 ID 还是配置文件,因此当您将其重写为 URL 时,它会是http://steamcommunity.com/ID/0123456789?xml=1还是会它是http://steamcommunity.com/PROFILES/0123456789?xml=1我猜只有一个是对的,另一个是错的。

一旦您获得了正确的文件夹(无论是其 ID 还是 Profiles),成功的调用将返回一个 XML 文档,您必须从中提取数据。

更新二

好吧,我今天有一些空闲时间,所以我设法敲掉了这段代码,它与图像一起向下,我没有时间进行网页抓取,但我相信会有很多关于 SO 的示例其他用户问过类似问题的地方。希望这足以让您上路。

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Dim Reference As Long

  If Trim(TextBox1.Text) <> "" Then
    If IsNumeric(TextBox1.Text) Then
      Reference = Shell("c:\program files\internet explorer\iexplore.exe http://steamcommunity.com/profiles/" & Trim(TextBox1.Text) & "?xml=1")
    Else
      Reference = Shell("c:\program files\internet explorer\iexplore.exe http://steamcommunity.com/id/" & Trim(TextBox1.Text) & "?xml=1")
    End If
  Else
    MsgBox("No steam Id entered!", MsgBoxStyle.Critical, "Error")
  End If

End Sub


Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click

  If Trim(TextBox2.Text) <> "" Then
    TextBox3.Text = "http://steamcommunity/friends/add/" & TextBox2.Text
  Else
    MsgBox("No steam 64 Id specified!", MsgBoxStyle.Critical, "Error")
  End If

End Sub


Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click

Dim Reference As Long

  If Trim(TextBox3.Text) <> "" Then
    Reference = Shell("c:\program files\internet explorer\iexplore.exe " & Trim(TextBox3.Text))
  Else
    MsgBox("No steam 64 Id specified!", MsgBoxStyle.Critical, "Error")
  End If

End Sub

在此处输入图像描述

于 2013-03-23T03:53:29.517 回答