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
- Application.cs
- MeasureItemEvent.cs
- ClickablePoint.cs
- WebServiceFaultDesigner.cs
- FontFamilyIdentifier.cs
- ZipIOModeEnforcingStream.cs
- CompilerError.cs
- EncoderReplacementFallback.cs
- RemotingConfigParser.cs
- AttributeQuery.cs
- SafeLibraryHandle.cs
- IndentedWriter.cs
- Brush.cs
- ToolboxBitmapAttribute.cs
- AssociationSetMetadata.cs
- DesignerActionVerbList.cs
- StringBuilder.cs
- WinEventTracker.cs
- MultiByteCodec.cs
- LineSegment.cs
- Section.cs
- Help.cs
- TableLayoutCellPaintEventArgs.cs
- HandlerBase.cs
- FontEmbeddingManager.cs
- SafeEventLogWriteHandle.cs
- HitTestParameters.cs
- WebZone.cs
- TextDecoration.cs
- ConfigXmlText.cs
- PeerResolverSettings.cs
- HttpPostServerProtocol.cs
- ExceptionHelpers.cs
- UnaryExpression.cs
- ItemsControlAutomationPeer.cs
- PathFigureCollectionValueSerializer.cs
- RecommendedAsConfigurableAttribute.cs
- QilTargetType.cs
- ExpressionConverter.cs
- InspectionWorker.cs
- EditorPart.cs
- ListViewInsertEventArgs.cs
- OSFeature.cs
- ProfileBuildProvider.cs
- EventLogQuery.cs
- _ContextAwareResult.cs
- Base64Encoding.cs
- NameHandler.cs
- BasePropertyDescriptor.cs
- WebBrowserUriTypeConverter.cs
- EditingCommands.cs
- InkPresenterAutomationPeer.cs
- PagedDataSource.cs
- Latin1Encoding.cs
- SqlException.cs
- CookieProtection.cs
- WebPartConnectVerb.cs
- DrawingImage.cs
- WmfPlaceableFileHeader.cs
- baseaxisquery.cs
- PointConverter.cs
- TreeWalkHelper.cs
- ImageClickEventArgs.cs
- ProfileEventArgs.cs
- CookieProtection.cs
- ConfigurationFileMap.cs
- SafeSystemMetrics.cs
- DelayedRegex.cs
- BackStopAuthenticationModule.cs
- InputReferenceExpression.cs
- SerializationIncompleteException.cs
- ProxyElement.cs
- ZipPackage.cs
- ProcessHostFactoryHelper.cs
- ResponseStream.cs
- ExtensionCollection.cs
- FileInfo.cs
- TemplateColumn.cs
- TcpStreams.cs
- Point3D.cs
- XmlValidatingReaderImpl.cs
- CommandID.cs
- IdentityManager.cs
- TCEAdapterGenerator.cs
- SchemaTypeEmitter.cs
- ByteStreamGeometryContext.cs
- COM2IPerPropertyBrowsingHandler.cs
- StringToken.cs
- ConfigXmlSignificantWhitespace.cs
- HandleValueEditor.cs
- ImageBrush.cs
- ExceptionHandler.cs
- Errors.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SingleAnimation.cs
- SystemInfo.cs
- XmlBinaryReader.cs
- XmlDigitalSignatureProcessor.cs
- AuthenticationSection.cs
- SplitterCancelEvent.cs