C# - How do I get the URL of an icon from Steam Trading API (encoded)

谁说胖子不能爱 提交于 2019-12-14 04:26:04

问题


Here is the part of the XML that the API returns for every item:

<message>
    <appid>730</appid>
    <classid>469467368</classid>
    <instanceid>302028390</instanceid>
    <currency>false</currency>
    <background_color/>
    <icon_url>
    -9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou6ryFA957PfMYTxW09SzlZaS2aX3MOvSlzlQucdy2LqU9NmnjAzl_UJoYmqldYSTIQI_NV_X81bvkufxxcjryPo2vmI
    </icon_url>
</message>

How do I parse and convert this string to an URL?

Thanks!


回答1:


I've never used this Api. I searched on google and i came on this answer: Steam Web API: I'm not sure what to do with this hash looking url to generate an image with it. It seems you just need to prepend the http://cdn.steamcommunity.com/economy/image/ before the url string.

The image link in your case should be: http://cdn.steamcommunity.com/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou6ryFA957PfMYTxW09SzlZaS2aX3MOvSlzlQucdy2LqU9NmnjAzl_UJoYmqldYSTIQI_NV_X81bvkufxxcjryPo2vmI



来源:https://stackoverflow.com/questions/33066161/c-sharp-how-do-i-get-the-url-of-an-icon-from-steam-trading-api-encoded

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!