Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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 check 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. // // ==--== /*============================================================================== ** ** 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 check new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path).Demand(); return path; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SoapUnknownHeader.cs
- XmlSerializationReader.cs
- XmlAttribute.cs
- TextShapeableCharacters.cs
- ToolStripOverflow.cs
- Rfc2898DeriveBytes.cs
- DeploymentSectionCache.cs
- TreeNodeStyle.cs
- TextParagraphView.cs
- InsufficientMemoryException.cs
- StylusPointPropertyInfo.cs
- Keywords.cs
- XmlChildNodes.cs
- ActivityStatusChangeEventArgs.cs
- objectresult_tresulttype.cs
- HeaderUtility.cs
- DataGridColumn.cs
- Int32AnimationBase.cs
- TraceSwitch.cs
- DetailsViewUpdateEventArgs.cs
- ImageIndexEditor.cs
- NavigationProperty.cs
- NullableLongMinMaxAggregationOperator.cs
- IxmlLineInfo.cs
- followingsibling.cs
- RadioButtonStandardAdapter.cs
- LifetimeServices.cs
- ExpressionContext.cs
- ApplicationSettingsBase.cs
- ToolZone.cs
- TextModifier.cs
- DataGridViewSortCompareEventArgs.cs
- DataGridViewCellStyleChangedEventArgs.cs
- FixedBufferAttribute.cs
- FormViewPagerRow.cs
- DllNotFoundException.cs
- SectionRecord.cs
- ThreadStateException.cs
- WinEventHandler.cs
- InputLanguageSource.cs
- TraceLog.cs
- SqlFlattener.cs
- _SslSessionsCache.cs
- ClickablePoint.cs
- PrintDialogException.cs
- HttpStreamXmlDictionaryWriter.cs
- AspProxy.cs
- CodeGeneratorOptions.cs
- ArrayElementGridEntry.cs
- RectAnimationBase.cs
- WpfPayload.cs
- WmlImageAdapter.cs
- CheckBoxStandardAdapter.cs
- XamlStackWriter.cs
- QilPatternVisitor.cs
- LinkedResource.cs
- TreeViewCancelEvent.cs
- DbFunctionCommandTree.cs
- ScrollChangedEventArgs.cs
- XmlSchemaAttributeGroupRef.cs
- PropertyGridEditorPart.cs
- FacetChecker.cs
- ObjectDataSourceSelectingEventArgs.cs
- ListControlConvertEventArgs.cs
- SourceInterpreter.cs
- ProgressBarHighlightConverter.cs
- PreservationFileWriter.cs
- RepeaterCommandEventArgs.cs
- WrappedIUnknown.cs
- DBConcurrencyException.cs
- MetadataItemEmitter.cs
- ADConnectionHelper.cs
- Compilation.cs
- ListViewGroupConverter.cs
- RelatedEnd.cs
- BooleanFacetDescriptionElement.cs
- PasswordDeriveBytes.cs
- EdmComplexPropertyAttribute.cs
- ClipboardData.cs
- UInt16Converter.cs
- InstanceData.cs
- Control.cs
- NamespaceList.cs
- TextBoxDesigner.cs
- TextDecorationLocationValidation.cs
- AddingNewEventArgs.cs
- SlipBehavior.cs
- OdbcParameterCollection.cs
- SqlDependencyListener.cs
- WSTrustFeb2005.cs
- RotateTransform.cs
- SettingsSavedEventArgs.cs
- NonSerializedAttribute.cs
- SmtpCommands.cs
- User.cs
- PersonalizationProvider.cs
- TextEmbeddedObject.cs
- FreezableOperations.cs
- WebServiceMethodData.cs
- SessionStateContainer.cs