Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / SyntaxCheck.cs / 1305376 / SyntaxCheck.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Security.Permissions; ////// /// SyntaxCheck /// Helper class to check for path and machine name syntax. /// [HostProtection(SharedState = true)] public static class SyntaxCheck { ////// Checks the syntax of the machine name (no "\" anywhere in it). /// ///public static bool CheckMachineName(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Machine names shouldn't contain any "\" return (value.IndexOf('\\') == -1); } /// /// Checks the syntax of the path (must start with "\\"). /// ///public static bool CheckPath(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Path names should start with "\\" return value.StartsWith("\\\\"); } /// /// Checks the syntax of the path (must start with "\" or drive letter "C:"). /// NOTE: These denote a file or directory path!! /// /// ///public static bool CheckRootedPath(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Is it rooted? return Path.IsPathRooted(value); } } } // 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
- ReferenceConverter.cs
- EntityClientCacheEntry.cs
- XslVisitor.cs
- JsonServiceDocumentSerializer.cs
- Vector3D.cs
- SynchronizedDispatch.cs
- MembershipUser.cs
- FrameSecurityDescriptor.cs
- Socket.cs
- DbParameterHelper.cs
- LogSwitch.cs
- DrawingImage.cs
- Memoizer.cs
- AssemblyCollection.cs
- WebPartPersonalization.cs
- MessageFault.cs
- oledbmetadatacollectionnames.cs
- PageBreakRecord.cs
- ResourcePart.cs
- SR.cs
- NumberEdit.cs
- MD5.cs
- DynamicAttribute.cs
- EntityDesignerDataSourceView.cs
- EndpointAddressMessageFilter.cs
- SqlFileStream.cs
- WinEventTracker.cs
- CustomCredentialPolicy.cs
- bindurihelper.cs
- FrameworkContentElement.cs
- MulticastOption.cs
- TableLayoutSettingsTypeConverter.cs
- Win32KeyboardDevice.cs
- SqlStatistics.cs
- TextElementEnumerator.cs
- FixedSOMGroup.cs
- ViewBase.cs
- DataGridState.cs
- UMPAttributes.cs
- ActivationArguments.cs
- ToolTip.cs
- ClassData.cs
- XmlEnumAttribute.cs
- GcSettings.cs
- NavigationWindowAutomationPeer.cs
- BitmapSizeOptions.cs
- ReaderContextStackData.cs
- ScriptHandlerFactory.cs
- SQLMembershipProvider.cs
- DataGridViewLinkColumn.cs
- PropertyInformation.cs
- ToolStripLabel.cs
- EntityUtil.cs
- NodeLabelEditEvent.cs
- TransformProviderWrapper.cs
- Utils.cs
- FileRecordSequence.cs
- TraceContextEventArgs.cs
- DesignTimeParseData.cs
- GenericXmlSecurityToken.cs
- DefaultValueAttribute.cs
- ExceptionHelpers.cs
- Mouse.cs
- MarkupCompiler.cs
- DataKeyCollection.cs
- IntSecurity.cs
- PolicyChain.cs
- Ref.cs
- ActivityDesignerLayoutSerializers.cs
- UInt32Converter.cs
- SqlAliasesReferenced.cs
- MenuItemBindingCollection.cs
- PropertyConverter.cs
- CodeGenerator.cs
- PageThemeParser.cs
- ChangePassword.cs
- BlurEffect.cs
- CqlErrorHelper.cs
- WebContext.cs
- ExceptionRoutedEventArgs.cs
- FontSource.cs
- FixedTextSelectionProcessor.cs
- CodeBlockBuilder.cs
- HierarchicalDataSourceIDConverter.cs
- NumericUpDownAccelerationCollection.cs
- ModulesEntry.cs
- ResourceDictionaryCollection.cs
- XmlBinaryWriter.cs
- HttpCapabilitiesSectionHandler.cs
- Image.cs
- IndexedEnumerable.cs
- PriorityBindingExpression.cs
- NamespaceInfo.cs
- GatewayDefinition.cs
- AuthenticationModuleElementCollection.cs
- MiniMapControl.xaml.cs
- SHA384.cs
- SerializationInfo.cs
- WeakReference.cs
- ExtensionDataReader.cs