Visual Basic如何格式化服务器响应? [英] Visual Basic how format server response ?

查看:50
本文介绍了Visual Basic如何格式化服务器响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从服务器格式化此响应以获取g_gametype或mapname的值?我想获取一个地图名称并将其分配给文本框,这是可能的吗?

????打印
服务器信息设置:
g_compassShowEnemies0
g_gametype sd
游戏名称《使命召唤4》
映射名称mp_backlot
协议6
shortversion 1.7
sv_allowAnonymous 0
sv_disableClientConsole0
sv_floodprotect 1
sv_hostname CoDWaWHost
sv_maxclients 10
sv_maxPing 0
sv_maxRate 25000
sv_minPing 0
sv_privateClients 0
sv_punkbuster 0
sv_pure 1
sv_voice 0
ui_maxclients 32

How format this response from server to get a values of g_gametype or mapname ? i want to get a mapname and assign it to the textbox it is possible ?

????print
Server info settings:
g_compassShowEnemies0
g_gametype sd
gamename Call of Duty 4
mapname mp_backlot
protocol 6
shortversion 1.7
sv_allowAnonymous 0
sv_disableClientConsole0
sv_floodprotect 1
sv_hostname CoDWaWHost
sv_maxclients 10
sv_maxPing 0
sv_maxRate 25000
sv_minPing 0
sv_privateClients 0
sv_punkbuster 0
sv_pure 1
sv_voice 0
ui_maxclients 32

推荐答案

使用以下代码

use the below code

Temp.Substring(Temp.IndexOf("g_gametype") + 10, Temp.IndexOf("gamename")-16 )



Temp保留服务器响应的位置.

抱歉..,我正在用C#提供代码.同样可以在VB中进行翻译.



where Temp Holds your server response .

Sorry.., i am providing code in C#.., same can translate in VB .


您能举个例子吗?而且它是字符串形式的
can you give me a example of that ? and it is in a string


好,非常感谢,现在我可以继续这个了:)
ok thank you very much, now i can move on with this :)


这篇关于Visual Basic如何格式化服务器响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆