问题标签 [downloadstring]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - WebClient.DownloadString result is not match with Browser result 2
The following code:
code returns:
when I visit that URL in any web browser, I get:
is there any way to get right string?
also, I use this online Decoder, but I don't get right answer: Universal Online Decoder
c# - 无法解析的 StackExchange API 响应
我编写了一个小程序来分析来自 StackExchange API 的个人资料数据,但该 api 将无法解析/无法读取的数据返回给我。
收到的数据:(使用c#自行下载)
\u001f�\b\0\0\0\0\0\u0004\0mRMo�0\f�/:�d$�c˱�'�^{/\u0006��\u0018G�>\I�� \u0015...... \u0018tk��\u0014�M]r�dLG�v0~Fj=����1\u00031I�>kTRA\"(/+.����;Nl\u0018�?h�\u0014��P藄 �X�aL��w���#�3\u0002��+�\u007f����\u0010����\u000f�p]��v\u007f����\t�����\ nf��״\u0018\u0014eƺ�_��1x#j^-�c� AX\t���\u001aT��@qj\u001aU7������\u0014\"\a^\b� #\u001e��QG��%�y�\t�ח������q00K\av\u0011{ظ���\u0005\"\u001d+|\u007f����'�\u0016~� �8\u007f�\u0001-h�]O\u007fV�o\u007f\u0001~Y\u0003��\u0002\0\0
想要的数据:(从我的浏览器复制粘贴)
{"items":[{"badge_counts",{"bronze":987,"silver":654,"gold":321},"account_id":123456789,"is_employee":false,"last_modified_date":1250612752," last_access_date":1250540770,"age":0,"reputation_change_year":987,"reputation_change_quarter":654,"reputation_change_month":321,"reputation_change_week":98,"reputation_change_day":76,"reputation":9876,"creation_date" :1109670518,"user_type":"registered","user_id":123456789,"accept_rate":0,"location":"Australia","website_url":" http://example.org ","link":" http://example.org/username ","profile_image":" http://example.org/username/icon.png ","display_name":"username"}],"has_more":false,"quota_max":300,"quota_remaining":300}
我写了这个(扩展)方法来从互联网上下载一个字符串:
然后我在互联网上搜索并找到了一种下载字符串的方法,使用了其他一些策略:
但是这两种方法都返回相同的(未读/不可解析的)数据。
如何从 API 获取可读数据?有什么遗漏吗?
c# - 使用 client.DownloadString 并再次返回 HTML
我使用 C# windows form 应用程序,我想下载内容网站,并在编辑后显示在外部浏览器中。
如何在外部浏览器中显示 String html (s)?看待。
c# - Webclient.DownloadString 不检索整个页面
我正在尝试使用 WebClient.DownloadString 检索站点的源,但是当我调试字符串时,我正在将源写入它似乎切断了 html 源的一部分。
代码:
所以我想知道为什么会这样?如果需要其他信息,我会发布。谢谢阅读!
c# - WebClient DownloadString 未获取所有信息
我正在尝试执行以下操作:
当我转到网址时(这不是真正的网址,当然,“bladibla”不是实际的用户名),我可以看到所有信息。当我查看 picasaxml 时,我缺少部分信息。文档中缺少一些 xml 部分。
谁能帮我?
-- 更新 -- 真正的 url 是:https ://picasaweb.google.com/data/feed/api/user/tim@boerenbond.be?thumbsize=206c 所以如果你去那个 url,你应该得到很多信息,包括在那里创建的一些相册的名称。但是当我运行代码显示得更高时,我没有得到所有这些信息。
好的,我刚刚注意到,当我转到另一台机器上的页面时,我也没有获得所有信息。
c# - 从带有锚标签的网站获取源代码
我在私人魔兽服务器上玩,我想从网站上获取玩家名称。
我尝试了该DownloadString
方法,但它不起作用。
这是链接:/information#allrealm
但我只能从/information获取来源。它不考虑#allrealm标签。所以我不能得到球员的名字。
如何使用#allrealm
标签从网站获取源代码?
c# - 如何同时运行多个 WebClients?
这是我的代码
示例 urlwebapi
该代码只能在一个urlwebapi上同时运行一个。执行代码时如何获得然后立即同时运行最多 5 个urlwebapi(example1.com 直到 example5.com)
c# - WebClient.DownloadString("Website.com/text.txt") 返回 html
因此,我通过 FTP 将文本文件上传到我的网站,我的网站完美显示文本并接受格式,但是每当我执行 webclient.downloadstring 时,它都会返回:
powershell - 下载字符串路径错误
我正在使用Invoke-Expression
PowerShell 中的 cmdlet 来加载模块。
以下代码按预期工作。
但是当我尝试使用变量来分割域和页面时。
我收到以下路径错误:
有人能帮我吗?提前致谢。
c# - 使用 DownloadString 的某些 URL 上出现无法捕获的 NullException
这是 Visual Studio 2015 中的错误还是?
我正在关注的代码/教程......
https://www.codeproject.com/Tips/397574/Use-Csharp-to-get-JSON-Data-from-the-Web-and-Map-i
要复制创建一个表单应用程序并添加一个名为“button1”的按钮,并为 button1_Click 函数添加此代码,URL 中的 http 不会出错,https 会出错...