Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / xsp / System / Web / Extensions / Util / HexParser.cs / 1 / HexParser.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System; using System.Globalization; using System.Text; internal static class HexParser { public static byte[] Parse(string token) { byte[] tokenBytes = new byte[token.Length / 2]; for (int i = 0; i < tokenBytes.Length; i++) { tokenBytes[i] = Byte.Parse(token.Substring(i * 2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture); } return tokenBytes; } public static string ToString(byte[] tokenBytes) { StringBuilder tokenBuilder = new StringBuilder(tokenBytes.Length * 2); for (int i = 0; i < tokenBytes.Length; i++) { tokenBuilder.Append(tokenBytes[i].ToString("x2", CultureInfo.InvariantCulture)); } return tokenBuilder.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System; using System.Globalization; using System.Text; internal static class HexParser { public static byte[] Parse(string token) { byte[] tokenBytes = new byte[token.Length / 2]; for (int i = 0; i < tokenBytes.Length; i++) { tokenBytes[i] = Byte.Parse(token.Substring(i * 2, 2), NumberStyles.HexNumber, CultureInfo.InvariantCulture); } return tokenBytes; } public static string ToString(byte[] tokenBytes) { StringBuilder tokenBuilder = new StringBuilder(tokenBytes.Length * 2); for (int i = 0; i < tokenBytes.Length; i++) { tokenBuilder.Append(tokenBytes[i].ToString("x2", CultureInfo.InvariantCulture)); } return tokenBuilder.ToString(); } } } // 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
- GridPattern.cs
- Rect3DConverter.cs
- OracleParameterCollection.cs
- SecondaryIndexList.cs
- SqlOuterApplyReducer.cs
- XmlSerializerNamespaces.cs
- WeakRefEnumerator.cs
- WebServiceData.cs
- DoubleAnimationClockResource.cs
- PathFigureCollectionConverter.cs
- TimeoutException.cs
- WebBrowserProgressChangedEventHandler.cs
- OdbcInfoMessageEvent.cs
- CallSiteOps.cs
- SettingsPropertyNotFoundException.cs
- BrowserCapabilitiesCompiler.cs
- HtmlGenericControl.cs
- SourceSwitch.cs
- OpenTypeCommon.cs
- OperatingSystem.cs
- ActivityDesignerHighlighter.cs
- XmlSchemaComplexContentExtension.cs
- TakeQueryOptionExpression.cs
- DelegatingTypeDescriptionProvider.cs
- DefaultValidator.cs
- Viewport3DAutomationPeer.cs
- NonBatchDirectoryCompiler.cs
- AutomationPattern.cs
- FormViewRow.cs
- ComponentChangedEvent.cs
- WeakKeyDictionary.cs
- AccessedThroughPropertyAttribute.cs
- SyndicationDeserializer.cs
- DataGridViewElement.cs
- WebBrowserBase.cs
- Select.cs
- AjaxFrameworkAssemblyAttribute.cs
- Panel.cs
- SecurityKeyType.cs
- InvalidProgramException.cs
- WebPartHelpVerb.cs
- CoreChannel.cs
- HttpRawResponse.cs
- SafeCloseHandleCritical.cs
- CharacterBuffer.cs
- DocumentViewerBaseAutomationPeer.cs
- ExpandableObjectConverter.cs
- DelegatingTypeDescriptionProvider.cs
- X509Certificate2.cs
- WebResourceAttribute.cs
- XPathCompileException.cs
- unsafeIndexingFilterStream.cs
- PtsHost.cs
- SupportsEventValidationAttribute.cs
- WindowsSlider.cs
- DiagnosticsConfiguration.cs
- UriScheme.cs
- StrongName.cs
- EnlistmentTraceIdentifier.cs
- FormClosingEvent.cs
- ControlTemplate.cs
- EditBehavior.cs
- WebServiceResponse.cs
- xdrvalidator.cs
- TableRowCollection.cs
- WindowsScroll.cs
- FixedSOMLineCollection.cs
- TagPrefixCollection.cs
- Rotation3DKeyFrameCollection.cs
- CreateUserWizardStep.cs
- ContainerParaClient.cs
- FixedTextView.cs
- BindingWorker.cs
- HttpResponseInternalBase.cs
- SoapIgnoreAttribute.cs
- EntityTemplateUserControl.cs
- SamlNameIdentifierClaimResource.cs
- ErrorWebPart.cs
- cryptoapiTransform.cs
- DataPager.cs
- GeneralTransform3D.cs
- MobileUserControl.cs
- ProfileInfo.cs
- HwndStylusInputProvider.cs
- DictionaryEditChange.cs
- Application.cs
- DataContractSerializerOperationBehavior.cs
- Material.cs
- OracleBoolean.cs
- PackWebResponse.cs
- NoneExcludedImageIndexConverter.cs
- BamlWriter.cs
- WebPartDisplayModeCollection.cs
- WebPartHelpVerb.cs
- TextContainer.cs
- DynamicAttribute.cs
- FileUpload.cs
- ClientSideQueueItem.cs
- Int32CollectionValueSerializer.cs
- EdmProviderManifest.cs