我試圖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)'。謝謝。 –