我试图DirectCast对JSON,使用下面的代码 -如何在Visual Basic 2013中的DirectCast中使用字符串?
的问题是,上述方法仅适用,如果我硬编码的电子邮件ID到URL。例如DirectCast("http://localhost/[email protected]", HttpWebRequest)
。当尝试获取电子邮件ID作为变量,我得到下面的错误 - 类型
价值“字符串”不能转换为 “System.Net.HttpWebRequest”。
请帮我做这个工作。
['DirectCast'(http://msdn.microsoft.com/en-us/library/7k6y2h6x.aspx)是不是从东西一切转换工具。 –
如果'DirectCast(URL,HttpWebRequest)'不起作用,我非常怀疑'DirectCast(“http://localhost/[email protected]”,HttpWebRequest)“正在工作。你可能想仔细检查一下。 –
@ roryap感谢提醒我再次检查。我忘了在DirectCast(WebRequest.Create(URL),HttpWebRequest)中添加'WebRequest.Create(URL)'。谢谢。 –