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
- selecteditemcollection.cs
- SectionVisual.cs
- TextDpi.cs
- InvalidComObjectException.cs
- PerSessionInstanceContextProvider.cs
- SqlRewriteScalarSubqueries.cs
- CompatibleComparer.cs
- HtmlInputCheckBox.cs
- WebEventTraceProvider.cs
- WindowsProgressbar.cs
- FileSystemInfo.cs
- PolicyUnit.cs
- GridView.cs
- DirectoryObjectSecurity.cs
- VirtualPathUtility.cs
- IOThreadTimer.cs
- Rect3DConverter.cs
- ContractSearchPattern.cs
- UInt16.cs
- CompositeActivityDesigner.cs
- _UriTypeConverter.cs
- StreamGeometry.cs
- AuthorizationRuleCollection.cs
- XamlPoint3DCollectionSerializer.cs
- DependencyPropertyConverter.cs
- TextTabProperties.cs
- InvalidStoreProtectionKeyException.cs
- PhysicalAddress.cs
- Point3DCollectionConverter.cs
- ServicePointManager.cs
- IntSecurity.cs
- ConfigsHelper.cs
- XmlAttributeOverrides.cs
- Operators.cs
- PackageDigitalSignatureManager.cs
- Int64Storage.cs
- DoubleAnimationBase.cs
- Psha1DerivedKeyGenerator.cs
- DictionaryGlobals.cs
- ClientCredentialsSecurityTokenManager.cs
- HtmlUtf8RawTextWriter.cs
- DesignerForm.cs
- SqlDependencyUtils.cs
- PageParserFilter.cs
- AdornedElementPlaceholder.cs
- Activation.cs
- Lock.cs
- XmlNavigatorFilter.cs
- DecimalAnimationBase.cs
- MetadataItemEmitter.cs
- SetStoryboardSpeedRatio.cs
- DbConnectionPoolIdentity.cs
- ConvertEvent.cs
- OdbcException.cs
- InvalidOperationException.cs
- ColorPalette.cs
- DataGridViewImageCell.cs
- BindToObject.cs
- MachineKeySection.cs
- Point3DCollectionValueSerializer.cs
- ObjectViewListener.cs
- CallbackHandler.cs
- EqualityComparer.cs
- XamlWriter.cs
- HyperLink.cs
- HttpHandlerActionCollection.cs
- Base64Decoder.cs
- DesignerVerbCollection.cs
- _DigestClient.cs
- ToolStripMenuItem.cs
- PathFigure.cs
- AsmxEndpointPickerExtension.cs
- SwitchElementsCollection.cs
- BuildManagerHost.cs
- Validator.cs
- JapaneseLunisolarCalendar.cs
- QueryResponse.cs
- SkinBuilder.cs
- OdbcError.cs
- NativeMethods.cs
- CurrencyManager.cs
- ColorBlend.cs
- RSACryptoServiceProvider.cs
- _AuthenticationState.cs
- XmlFormatExtensionPrefixAttribute.cs
- ValueQuery.cs
- DataGridViewCheckBoxColumn.cs
- WeakRefEnumerator.cs
- CommonGetThemePartSize.cs
- WarningException.cs
- EDesignUtil.cs
- ConstantSlot.cs
- ColumnReorderedEventArgs.cs
- AutomationAttributeInfo.cs
- ExpressionPrefixAttribute.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- ObjectParameter.cs
- Container.cs
- SqlCommandBuilder.cs
- ExpressionVisitor.cs