Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Runtime / InteropServices / RuntimeEnvironment.cs / 1 / RuntimeEnvironment.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: RuntimeEnvironment ** ** ** Purpose: Runtime information ** ** =============================================================================*/ using System; using System.Text; using System.IO; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Reflection; using Microsoft.Win32; namespace System.Runtime.InteropServices { [System.Runtime.InteropServices.ComVisible(true)] public class RuntimeEnvironment { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String GetModuleFileName(); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String GetDeveloperPath(); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String GetHostBindingFile(); [DllImport(Win32Native.SHIM, CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)] private static extern int GetCORVersion(StringBuilder sb, int BufferLength, ref int retLength); [MethodImplAttribute(MethodImplOptions.InternalCall)] public static extern bool FromGlobalAccessCache(Assembly a); public static String GetSystemVersion() { StringBuilder s = new StringBuilder(256); int retLength = 0; if(GetCORVersion(s, 256, ref retLength) == 0) return s.ToString(); else return null; } public static String GetRuntimeDirectory() { String dir = GetRuntimeDirectoryImpl(); new FileIOPermission(FileIOPermissionAccess.PathDiscovery, dir).Demand(); return dir; } [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String GetRuntimeDirectoryImpl(); // Returns the system ConfigurationFile public static String SystemConfigurationFile { get { StringBuilder sb = new StringBuilder(Path.MAX_PATH); sb.Append(GetRuntimeDirectory()); sb.Append(AppDomainSetup.RuntimeConfigurationFile); String path = sb.ToString(); // Do security new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path).Demand(); return path; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DSASignatureDeformatter.cs
- WebPartRestoreVerb.cs
- RequestQueryParser.cs
- IconConverter.cs
- BuilderPropertyEntry.cs
- WindowsRebar.cs
- PrintPageEvent.cs
- TypeUsageBuilder.cs
- ExtensionQuery.cs
- OperationBehaviorAttribute.cs
- ClientTargetSection.cs
- DbConnectionOptions.cs
- PageContentCollection.cs
- ListMarkerSourceInfo.cs
- HandlerMappingMemo.cs
- SourceElementsCollection.cs
- BookmarkUndoUnit.cs
- ToolStripDropDownItem.cs
- ConfigXmlAttribute.cs
- CommandEventArgs.cs
- ButtonFlatAdapter.cs
- JsonDeserializer.cs
- PtsHost.cs
- RuntimeHandles.cs
- HttpStreamXmlDictionaryReader.cs
- TimelineGroup.cs
- LiteralText.cs
- PresentationAppDomainManager.cs
- ClientRuntimeConfig.cs
- QilReference.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- UpdatePanelControlTrigger.cs
- VerificationException.cs
- EntityTypeBase.cs
- TypeDescriptor.cs
- WebServiceFaultDesigner.cs
- ProvidersHelper.cs
- DelimitedListTraceListener.cs
- EventLogSession.cs
- PageMediaSize.cs
- ParameterCollection.cs
- MappingModelBuildProvider.cs
- OletxTransactionFormatter.cs
- ElementHost.cs
- GifBitmapEncoder.cs
- SingleConverter.cs
- FixedHighlight.cs
- DataGridCommandEventArgs.cs
- MenuTracker.cs
- ImageBrush.cs
- FacetChecker.cs
- SyndicationDeserializer.cs
- FixedSOMContainer.cs
- SqlDataReaderSmi.cs
- DashStyle.cs
- EqualityComparer.cs
- EntityDataSourceChangedEventArgs.cs
- Selection.cs
- ItemsPresenter.cs
- AnchoredBlock.cs
- SqlBulkCopy.cs
- WorkflowApplicationUnloadedException.cs
- PageEventArgs.cs
- CapabilitiesRule.cs
- StrokeNodeEnumerator.cs
- BindingNavigator.cs
- NamedObjectList.cs
- HtmlTableCell.cs
- FieldNameLookup.cs
- LinqDataView.cs
- DiscoveryMessageSequence.cs
- Compiler.cs
- EventProxy.cs
- InvokePatternIdentifiers.cs
- CompiledELinqQueryState.cs
- SqlDependencyListener.cs
- XsdDuration.cs
- CodeDOMProvider.cs
- BroadcastEventHelper.cs
- DataGridRelationshipRow.cs
- DodSequenceMerge.cs
- FtpRequestCacheValidator.cs
- XmlIlVisitor.cs
- TraceContext.cs
- RijndaelManaged.cs
- MultiPropertyDescriptorGridEntry.cs
- CodePropertyReferenceExpression.cs
- EmptyEnumerable.cs
- HtmlLink.cs
- DefaultTextStore.cs
- _RequestCacheProtocol.cs
- WebPartManagerInternals.cs
- DataObjectMethodAttribute.cs
- ThreadExceptionEvent.cs
- CorrelationService.cs
- FileDialogPermission.cs
- StickyNoteContentControl.cs
- WebBodyFormatMessageProperty.cs
- ColorMap.cs
- HostProtectionException.cs