LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't access .NET Framework 2.0 WebRequest.DefaultWebProxy Property

 

I'm writing some LabVIEW code using .NET Framework 2.0 and need to include web proxy support for our corporate web proxy server.

 

To do this I need to call the WebRequest.DefaultWebProxy Property

 

http://msdn.microsoft.com/en-us/library/system.net.webrequest.defaultwebproxy(v=VS.80).aspx

 

Unfortunately the selection process ends short...

 

I'm selecting: Connectivity>.NET>Constructor Node>System(2.0.0.0)>System.net>WebRequest>"This class contains no public constructors".

 

I'm now wondering if this is something I'm doing wrong or a limitation of LabVIEW 10?

 

Help always appreciated

 

0 Kudos
Message 1 of 6
(4,271 Views)

My app also requires a feed from IWebProxy:

 

http://msdn.microsoft.com/en-us/library/system.net.iwebproxy(v=VS.80).aspx

 

Connectivity>.NET>Constructor Node>System(2.0.0.0)>System.net>IWebProxy>"This class contains no public constructors"

 

Anyone know anything about this?

0 Kudos
Message 2 of 6
(4,259 Views)

Further info:

GDataRequestFactory.Proxy Property

Namespace:  Google.GData.Client
Assembly:  Google.GData.Client (in Google.GData.Client.dll)
Version: 1.4.0.2

Syntax

 

C#
public IWebProxy Proxy { get; set; }
0 Kudos
Message 3 of 6
(4,257 Views)

Hi Andy,

 

I have tested out the behavior you described and found that the result was exactly the same. My understanding of this is that if there are no public constructors, you will only be able to access the static .NET properties and methods for that .NET object. You can access these properties and methods through the use of Property Nodes and Invoke Nodes in LabVIEW through the technique described here. You will notice that LabVIEW indicates a static property and method with a [S] at the beginning of the property or method name. I have tested this out and seem to be able to access the properties you need.

 

I hope this helps.

 

Best Regards,

 

Christian Hartshorne

NI|UK

0 Kudos
Message 4 of 6
(4,249 Views)

Hi Christian,

 

Many thanks for the tip on accessing static .NET properties.

 

I know realise that the (s) = static and understand how to access them.

 

My next step is to let the property = null i.e. WebRequest.DefaultWebProxy = null

I have searched the forum for an answer to this with no luck

Proxy .NET.jpg

 

 

Any ideas on how to set the above to null? It may be obvious?

 

 

 

0 Kudos
Message 5 of 6
(4,220 Views)

arr OK found the last post of this thread - hoping this is a null:

 

http://forums.ni.com/t5/LabVIEW/How-can-I-input-a-null-value-into-a-NET-method-via-LabVIEW-s/m-p/143...

 

"Creating a constant from the method's input parameter seemed to work for me..."

0 Kudos
Message 6 of 6
(4,214 Views)