Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Util / HexParser.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataBoundControlHelper.cs
- CombinedGeometry.cs
- ValidatedControlConverter.cs
- UriTemplateTrieLocation.cs
- CompiledIdentityConstraint.cs
- BufferedStream2.cs
- HostingEnvironmentSection.cs
- CommonObjectSecurity.cs
- Matrix3D.cs
- ResourceManagerWrapper.cs
- Intellisense.cs
- TabletCollection.cs
- PathSegment.cs
- ObsoleteAttribute.cs
- ControlType.cs
- FormViewCommandEventArgs.cs
- WebPartZoneBase.cs
- BindingContext.cs
- MatrixUtil.cs
- ResourceReferenceExpression.cs
- SafeRegistryHandle.cs
- _HTTPDateParse.cs
- MILUtilities.cs
- InstanceLockedException.cs
- StylusPlugin.cs
- TokenCreationException.cs
- FieldCollectionEditor.cs
- SecurityManager.cs
- VectorAnimationUsingKeyFrames.cs
- VectorAnimationBase.cs
- filewebresponse.cs
- dataprotectionpermissionattribute.cs
- DbReferenceCollection.cs
- DataGridViewCell.cs
- PersonalizableTypeEntry.cs
- storepermissionattribute.cs
- ListBoxAutomationPeer.cs
- ProtectedConfigurationSection.cs
- ImportDesigner.xaml.cs
- PeerTransportSecuritySettings.cs
- TextRunCacheImp.cs
- Size3D.cs
- StrokeCollectionConverter.cs
- DataContractAttribute.cs
- XmlDocument.cs
- MaskedTextBox.cs
- DbDataRecord.cs
- Single.cs
- ReadContentAsBinaryHelper.cs
- Application.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- LiteralTextParser.cs
- ControlUtil.cs
- BufferedGraphicsContext.cs
- SecurityElement.cs
- SoapClientMessage.cs
- CodeAccessPermission.cs
- TypeDependencyAttribute.cs
- Vector3DAnimationBase.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SmtpSection.cs
- WinEventWrap.cs
- ListDesigner.cs
- ThemeDictionaryExtension.cs
- FamilyTypefaceCollection.cs
- Function.cs
- WebContentFormatHelper.cs
- ContainerAction.cs
- NavigateEvent.cs
- DocumentXmlWriter.cs
- ProtocolsSection.cs
- ReadOnlyDataSourceView.cs
- EventProviderWriter.cs
- HwndStylusInputProvider.cs
- DbConnectionPoolGroupProviderInfo.cs
- UIElement3D.cs
- IRCollection.cs
- DragEventArgs.cs
- FixedPage.cs
- WindowClosedEventArgs.cs
- FaultHandlingFilter.cs
- NameValueFileSectionHandler.cs
- HandlerFactoryWrapper.cs
- CategoryGridEntry.cs
- ObjectDataSourceView.cs
- DocumentPageHost.cs
- XmlSchemaSimpleTypeUnion.cs
- TextServicesLoader.cs
- XmlQueryContext.cs
- RelationshipEndCollection.cs
- OptimizerPatterns.cs
- Axis.cs
- XmlSchemaDatatype.cs
- ControlDesigner.cs
- DictionaryBase.cs
- OdbcRowUpdatingEvent.cs
- SoundPlayerAction.cs
- ErrorLog.cs
- SqlDataSourceCache.cs
- SqlDataSource.cs