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
- FieldToken.cs
- MatchAttribute.cs
- NamespaceTable.cs
- ReferentialConstraint.cs
- CompiledRegexRunnerFactory.cs
- EntityDataSourceContextDisposingEventArgs.cs
- FontInfo.cs
- CallContext.cs
- LingerOption.cs
- WebFaultClientMessageInspector.cs
- DynamicValueConverter.cs
- ListChangedEventArgs.cs
- TextServicesManager.cs
- CaseInsensitiveOrdinalStringComparer.cs
- RotateTransform3D.cs
- RoutedUICommand.cs
- VisualBrush.cs
- BufferedGenericXmlSecurityToken.cs
- ParameterBinding.cs
- MenuBase.cs
- XmlMtomWriter.cs
- FloaterParaClient.cs
- SqlDependencyListener.cs
- SchemaConstraints.cs
- PolicyUnit.cs
- VersionedStream.cs
- BuildProvider.cs
- CounterSampleCalculator.cs
- SpecialNameAttribute.cs
- ContentFileHelper.cs
- Oid.cs
- IdnElement.cs
- ToolStripItemImageRenderEventArgs.cs
- ImageCreator.cs
- ObjectDataProvider.cs
- WeakReference.cs
- OleDbFactory.cs
- DocumentApplication.cs
- SecurityToken.cs
- CalloutQueueItem.cs
- WebPartUserCapability.cs
- GridView.cs
- GeneralTransform2DTo3DTo2D.cs
- DataSourceListEditor.cs
- IntermediatePolicyValidator.cs
- NoResizeSelectionBorderGlyph.cs
- ThousandthOfEmRealDoubles.cs
- SqlUserDefinedAggregateAttribute.cs
- BitmapEffect.cs
- NullableDecimalSumAggregationOperator.cs
- TextEndOfSegment.cs
- AuthenticationModuleElementCollection.cs
- BackgroundWorker.cs
- EncryptedXml.cs
- GridViewUpdatedEventArgs.cs
- safePerfProviderHandle.cs
- BevelBitmapEffect.cs
- WebPartCloseVerb.cs
- PointAnimationBase.cs
- RegexStringValidator.cs
- MouseGestureConverter.cs
- FontFamily.cs
- FixedTextContainer.cs
- Script.cs
- CodeTypeMember.cs
- UpdatePanelTriggerCollection.cs
- StringFormat.cs
- MetadataArtifactLoaderCompositeFile.cs
- DependencyPropertyKind.cs
- SpoolingTaskBase.cs
- Win32.cs
- FunctionUpdateCommand.cs
- XmlWhitespace.cs
- IsolatedStoragePermission.cs
- UrlAuthFailedErrorFormatter.cs
- ClientRuntimeConfig.cs
- SQLInt16.cs
- StrokeIntersection.cs
- WebPartChrome.cs
- Base64Decoder.cs
- DataGridItemEventArgs.cs
- SecurityHeaderTokenResolver.cs
- SecurityManager.cs
- TransactionTable.cs
- ISAPIApplicationHost.cs
- xmlsaver.cs
- SystemIPAddressInformation.cs
- CellParagraph.cs
- ProviderSettingsCollection.cs
- NetworkCredential.cs
- BaseParser.cs
- IndexedString.cs
- SafeBitVector32.cs
- SqlClientWrapperSmiStreamChars.cs
- HttpPostClientProtocol.cs
- WindowsBrush.cs
- _ListenerRequestStream.cs
- ToolBarTray.cs
- Directory.cs
- X509Utils.cs