Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- PipelineDeploymentState.cs
- InputChannel.cs
- TableDetailsCollection.cs
- entitydatasourceentitysetnameconverter.cs
- LayoutEngine.cs
- FixedTextBuilder.cs
- SecurityRequiresReviewAttribute.cs
- XmlSchemaAttribute.cs
- EncodingInfo.cs
- ScrollBarRenderer.cs
- ComplexPropertyEntry.cs
- AdjustableArrowCap.cs
- ParsedAttributeCollection.cs
- HtmlEncodedRawTextWriter.cs
- XmlAtomErrorReader.cs
- RotateTransform3D.cs
- TextEditor.cs
- Bezier.cs
- DynamicObject.cs
- ElementProxy.cs
- SystemWebExtensionsSectionGroup.cs
- XmlSchemaComplexType.cs
- AdvancedBindingPropertyDescriptor.cs
- ProviderCommandInfoUtils.cs
- XmlSchemaExporter.cs
- RootBrowserWindowProxy.cs
- WebPartCancelEventArgs.cs
- SqlExpressionNullability.cs
- GraphicsState.cs
- SqlTypeSystemProvider.cs
- PtsHost.cs
- ToolStripOverflowButton.cs
- TrustLevel.cs
- CollectionConverter.cs
- FixUpCollection.cs
- SchemaAttDef.cs
- NamespaceImport.cs
- Interlocked.cs
- DataConnectionHelper.cs
- ScriptResourceInfo.cs
- ContentPosition.cs
- AttributeEmitter.cs
- ComplusTypeValidator.cs
- Utils.cs
- ItemList.cs
- NavigatorInput.cs
- CodeCompileUnit.cs
- PerfService.cs
- NamedServiceModelExtensionCollectionElement.cs
- SmtpFailedRecipientsException.cs
- GroupBox.cs
- StdValidatorsAndConverters.cs
- ChannelToken.cs
- CommandField.cs
- XamlToRtfParser.cs
- ListControl.cs
- CheckedListBox.cs
- ReplacementText.cs
- GroupBoxDesigner.cs
- ScaleTransform3D.cs
- DuplicateDetector.cs
- PostBackOptions.cs
- ListParaClient.cs
- xdrvalidator.cs
- GPPOINTF.cs
- ConfigPathUtility.cs
- TdsRecordBufferSetter.cs
- RegexCharClass.cs
- BooleanFacetDescriptionElement.cs
- DataGridViewBindingCompleteEventArgs.cs
- MethodBuilder.cs
- TypeUtil.cs
- MenuDesigner.cs
- UrlMappingCollection.cs
- XmlWellformedWriter.cs
- SplitContainerDesigner.cs
- Registry.cs
- VariableQuery.cs
- ExtendedProperty.cs
- DefinitionUpdate.cs
- RadioButtonFlatAdapter.cs
- FontStretches.cs
- ColumnBinding.cs
- Composition.cs
- PasswordBoxAutomationPeer.cs
- BamlLocalizableResourceKey.cs
- DependsOnAttribute.cs
- BinaryFormatterWriter.cs
- XmlSignatureManifest.cs
- ViewBase.cs
- WindowsListViewGroupHelper.cs
- CreateUserWizardStep.cs
- XPathPatternParser.cs
- TreeChangeInfo.cs
- HttpGetClientProtocol.cs
- HttpListener.cs
- XmlQuerySequence.cs
- Function.cs
- ProbeMatchesCD1.cs
- Padding.cs