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
- String.cs
- XmlDocument.cs
- TabOrder.cs
- ArrayConverter.cs
- sqlinternaltransaction.cs
- _ConnectionGroup.cs
- MatrixUtil.cs
- DataObjectMethodAttribute.cs
- Command.cs
- RotateTransform.cs
- ByteRangeDownloader.cs
- FamilyCollection.cs
- Icon.cs
- CustomCredentialPolicy.cs
- Event.cs
- ObjectParameterCollection.cs
- InvalidCommandTreeException.cs
- IdentitySection.cs
- HostedAspNetEnvironment.cs
- Receive.cs
- TableParagraph.cs
- Thumb.cs
- TextContainerHelper.cs
- SmiEventStream.cs
- XmlILIndex.cs
- ProcessThreadCollection.cs
- CodeThrowExceptionStatement.cs
- SpellCheck.cs
- TextChangedEventArgs.cs
- DataBindEngine.cs
- XmlSerializerFactory.cs
- DragCompletedEventArgs.cs
- CrossContextChannel.cs
- MissingManifestResourceException.cs
- __Filters.cs
- HiddenFieldPageStatePersister.cs
- ProxyWebPart.cs
- XmlSchemaDatatype.cs
- GridViewUpdateEventArgs.cs
- PointAnimationBase.cs
- LocatorManager.cs
- StateFinalizationDesigner.cs
- RetriableClipboard.cs
- BuildDependencySet.cs
- ServiceKnownTypeAttribute.cs
- ParameterReplacerVisitor.cs
- CustomDictionarySources.cs
- ToolStripMenuItemCodeDomSerializer.cs
- HtmlForm.cs
- ApplicationDirectoryMembershipCondition.cs
- QueryCursorEventArgs.cs
- Expressions.cs
- BuildProviderCollection.cs
- TextHintingModeValidation.cs
- UnconditionalPolicy.cs
- DefaultHttpHandler.cs
- XmlCharCheckingWriter.cs
- hebrewshape.cs
- DecimalConstantAttribute.cs
- CellParaClient.cs
- AnimationClock.cs
- indexingfiltermarshaler.cs
- CodeTypeOfExpression.cs
- HotCommands.cs
- ServiceNotStartedException.cs
- XmlValidatingReaderImpl.cs
- StylusPlugin.cs
- TextSerializer.cs
- UInt64Storage.cs
- PrivilegedConfigurationManager.cs
- Point3DCollectionConverter.cs
- PageRanges.cs
- HtmlTableCell.cs
- ScriptIgnoreAttribute.cs
- ResourceAttributes.cs
- TemplateLookupAction.cs
- MetadataItemCollectionFactory.cs
- XPathNode.cs
- TextTreeRootNode.cs
- XmlSchemaSimpleTypeList.cs
- sqlcontext.cs
- XmlSchemaExporter.cs
- ImageAnimator.cs
- RowSpanVector.cs
- PropertyFilterAttribute.cs
- BoundField.cs
- EntityViewGenerationAttribute.cs
- DynamicResourceExtensionConverter.cs
- NetPeerTcpBindingCollectionElement.cs
- TextBoxView.cs
- XmlQuerySequence.cs
- HttpRuntime.cs
- SecurityTokenAuthenticator.cs
- MaskedTextProvider.cs
- TcpChannelHelper.cs
- BehaviorEditorPart.cs
- AttachedPropertyMethodSelector.cs
- ToolStripSystemRenderer.cs
- DecoderFallback.cs
- SafeLibraryHandle.cs