Public ReadOnly Property ISLogConnectionString As String Get Dim ScriptDefaultMode Dim StackTrace As New StackTrace() Dim StackFrame As StackFrame = StackTrace.GetFrame(1) Dim CallingProcName = StackFrame.GetMethod().Name ' what settings server are we going to look to first? Try ' look for an App.Config Setting of zDefaultRing (ISScriptingTemplate) in the EXE's ApplicationSettings Dim exeConfig As Configuration exeConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) Dim sectGroup As ApplicationSettingsGroup sectGroup = exeConfig.GetSectionGroup("applicationSettings") Dim sect As ClientSettingsSection sect = sectGroup.Sections(CallingProcName & ".My.MySettings") Dim elm As SettingElement elm = sect.Settings.Get("zDefaultRing") ScriptDefaultMode = elm.Value.ValueXml.InnerXml
System.Diagnostics.StackTrace
System.Reflection.Assembly entryAssembly = System.Reflection.Assembly.GetEntryAssembly(); // and this is its main executable module file: string exeFile = entryAssembly.Location;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)