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
- SpAudioStreamWrapper.cs
- EnumValAlphaComparer.cs
- ServicePerformanceCounters.cs
- ADMembershipUser.cs
- Msec.cs
- DiscoveryExceptionDictionary.cs
- XXXOnTypeBuilderInstantiation.cs
- EntityTemplateFactory.cs
- SamlSubjectStatement.cs
- GlobalizationSection.cs
- FormViewInsertEventArgs.cs
- ConfigurationLockCollection.cs
- GridViewDeleteEventArgs.cs
- RoleManagerEventArgs.cs
- propertyentry.cs
- ConfigurationSectionGroupCollection.cs
- HostExecutionContextManager.cs
- OrderByLifter.cs
- EdmProperty.cs
- OlePropertyStructs.cs
- SelectedPathEditor.cs
- ExtensionDataObject.cs
- DrawingBrush.cs
- IdnMapping.cs
- Partitioner.cs
- TreeView.cs
- webproxy.cs
- EntityContainerEmitter.cs
- TreeNodeBinding.cs
- XpsPackagingException.cs
- FamilyTypeface.cs
- XamlReaderConstants.cs
- IteratorDescriptor.cs
- NotificationContext.cs
- ClrPerspective.cs
- DataGridViewColumnConverter.cs
- SystemDiagnosticsSection.cs
- DocumentReferenceCollection.cs
- StatusBarPanelClickEvent.cs
- CardSpaceShim.cs
- objectresult_tresulttype.cs
- NamedObject.cs
- RadioButtonStandardAdapter.cs
- PrePrepareMethodAttribute.cs
- NetworkInformationPermission.cs
- BitmapEffectOutputConnector.cs
- InternalTypeHelper.cs
- StringAnimationUsingKeyFrames.cs
- ISCIIEncoding.cs
- MethodToken.cs
- AutomationEventArgs.cs
- ObjectSecurity.cs
- SystemUdpStatistics.cs
- SiteOfOriginContainer.cs
- ObjectStateFormatter.cs
- InputProcessorProfiles.cs
- ImageFormat.cs
- AttachedPropertyMethodSelector.cs
- MissingMethodException.cs
- WorkflowServiceHost.cs
- ProofTokenCryptoHandle.cs
- HeaderLabel.cs
- HtmlToClrEventProxy.cs
- ObjectAssociationEndMapping.cs
- GestureRecognitionResult.cs
- WebControlParameterProxy.cs
- WeakEventManager.cs
- PreviewKeyDownEventArgs.cs
- RectAnimationBase.cs
- XmlTextReaderImplHelpers.cs
- BindingMemberInfo.cs
- DataIdProcessor.cs
- UrlAuthFailureHandler.cs
- DesignerActionVerbList.cs
- BinaryFormatterWriter.cs
- DateTimeStorage.cs
- recordstatefactory.cs
- DataBindingsDialog.cs
- invalidudtexception.cs
- PrincipalPermission.cs
- Visual3D.cs
- PanelStyle.cs
- DataGridViewAdvancedBorderStyle.cs
- XmlCompatibilityReader.cs
- ProxyAttribute.cs
- UnsafeNativeMethods.cs
- PropertyDescriptor.cs
- StrongTypingException.cs
- AncestorChangedEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- Vector3DIndependentAnimationStorage.cs
- XmlReader.cs
- ResourceDictionary.cs
- Win32PrintDialog.cs
- EditorResources.cs
- PenContext.cs
- SignatureHelper.cs
- SqlCommand.cs
- SafeNativeMethods.cs
- EventHandlersStore.cs