From a code I found in VB.NET to ASP.NET I'm trying to adapt to use in a DLL in AutoCAD. What is shown in yellow does not compile.
Imports Autodesk.AutoCAD.Runtime
Imports System.Net
Imports System.Collections.Generic
Imports System.Web.Script.Serialization
Public Class IPGEO
Implements IExtensionApplication
Private Sub Initialize() Implements IExtensionApplication.Initialize
End Sub
Private Sub Terminate() Implements IExtensionApplication.Terminate
End Sub
<CommandMethod("IPGEO")> _
Public Sub IPGEO()
Dim ipAddress As String = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If String.IsNullOrEmpty(ipAddress) Then
ipAddress = Request.ServerVariables("REMOTE_ADDR")
End If
'
Dim APIKey As String = "<Your API Key>"
Dim url
As String = String.Format("http://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress
) '......
End Sub
End Class
edit:kdub -> remove hardcoded post colors and add line coloring in code=vbnet,4,14,16