Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SessionState.cs
- WorkflowCompensationBehavior.cs
- MultiSelectRootGridEntry.cs
- ObjectFullSpanRewriter.cs
- SqlRowUpdatingEvent.cs
- ValidationPropertyAttribute.cs
- NodeInfo.cs
- FamilyMap.cs
- EnumType.cs
- ForeignConstraint.cs
- CodeParameterDeclarationExpression.cs
- MetaData.cs
- Helper.cs
- DataChangedEventManager.cs
- SiteOfOriginContainer.cs
- MyContact.cs
- WebHeaderCollection.cs
- DataControlLinkButton.cs
- SQLCharsStorage.cs
- DataGridAddNewRow.cs
- ShaderRenderModeValidation.cs
- XmlILStorageConverter.cs
- HttpCacheParams.cs
- SamlSerializer.cs
- NetworkInformationPermission.cs
- SystemResourceHost.cs
- DesignerForm.cs
- SecurityUniqueId.cs
- CapabilitiesSection.cs
- ResourceExpression.cs
- PointHitTestResult.cs
- PolicyManager.cs
- JsonWriterDelegator.cs
- BinaryNode.cs
- DataControlField.cs
- XmlRawWriter.cs
- hwndwrapper.cs
- ObjectQuery.cs
- TimeSpanValidatorAttribute.cs
- StickyNote.cs
- QueryContinueDragEvent.cs
- DispatcherHookEventArgs.cs
- HighContrastHelper.cs
- ModelPropertyImpl.cs
- ValueChangedEventManager.cs
- PropertyValueChangedEvent.cs
- ListView.cs
- Misc.cs
- ActivationArguments.cs
- BamlLocalizableResourceKey.cs
- FixedSOMSemanticBox.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- SessionEndingCancelEventArgs.cs
- AutomationElementIdentifiers.cs
- OledbConnectionStringbuilder.cs
- Condition.cs
- MD5CryptoServiceProvider.cs
- UrlPath.cs
- InternalReceiveMessage.cs
- GreaterThan.cs
- TextServicesProperty.cs
- MobileUserControlDesigner.cs
- GCHandleCookieTable.cs
- GridViewDeletedEventArgs.cs
- FileStream.cs
- XPathNavigator.cs
- ServiceContractViewControl.Designer.cs
- StoryFragments.cs
- Polyline.cs
- FontFamily.cs
- TextRangeAdaptor.cs
- SelectedDatesCollection.cs
- RuntimeConfigurationRecord.cs
- DocumentViewerBaseAutomationPeer.cs
- PopOutPanel.cs
- EditingCommands.cs
- RSACryptoServiceProvider.cs
- XPathNodePointer.cs
- MDIControlStrip.cs
- Columns.cs
- DataPagerFieldCommandEventArgs.cs
- BitVector32.cs
- Style.cs
- XmlQualifiedNameTest.cs
- Geometry.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- Attributes.cs
- SslStream.cs
- TextSelection.cs
- ProgressBarAutomationPeer.cs
- InvalidDataContractException.cs
- Form.cs
- ProtocolReflector.cs
- RepeaterItem.cs
- DataGridCell.cs
- ToolStripRenderer.cs
- SerializerProvider.cs
- GroupBox.cs
- BindingGroup.cs
- DataServices.cs