There's so many places to put stuff. I think one of the most difficult things for new .NET developers is deciding where to store objects and bits of data.
There's certainly the obvious starting points:
public static System.LocalDataStoreSlot Slot= System.Threading.Thread.AllocateNamedDataSlot("webutil.proxy");
public static System.Net.WebProxy GetProxy()
{
object PutativeProxy = System.Threading.Thread.GetData(Slot);
if (PutativeProxy==null)
string ProxyString = System.Configuration.ConfigurationSettings.AppSettings[GetConfigKey("proxy")];
if ((ProxyString == null) || (ProxyString == "")) return null;
PutativeProxy = new System.Net.WebProxy(ProxyString, true);
System.Threading.Thread.SetData(Slot, PutativeProxy);
}
return (System.Net.WebProxy) PutativeProxy;
Ads by The Lounge