Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am having one function in COM Class of vb.net.
In which it gives error on following line.

Dim wr As Net.WebResponse = WebRequest.Create(strUrl.ToString).GetResponse
Dim reader As IO.StreamReader = New IO.StreamReader(wr.GetResponseStream)
MsgBox(reader.ReadToEnd)

It Runs on VB.Net app but when I copied this function to COM Class and was trying to access this function in vb it gives exception message as_

System.Net.Webexception:An attempt was made to access a socket in a way forbidden by its access permission


Please help me in it.

Thanks in advance.

Quick reply will be more appreciated. :)
Posted
Comments
Sergey Alexandrovich Kryukov 29-Jan-15 2:00am    
COM class? Why?
—SA
Rahul Kaswa 29-Jan-15 2:03am    
Wanted to use DLL in VB6 so using COM Class
CHill60 29-Jan-15 6:44am    
So this is VB6 not VB.NET as per your tag?
Rahul Kaswa 29-Jan-15 10:00am    
Developed in VB.NET Com Class and gave reference in old VB6 project.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900