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
- UnhandledExceptionEventArgs.cs
- _ListenerRequestStream.cs
- FileCodeGroup.cs
- DataGridBoolColumn.cs
- OperandQuery.cs
- InvokeMethod.cs
- HttpModuleActionCollection.cs
- ChangePassword.cs
- SourceExpressionException.cs
- SiteOfOriginContainer.cs
- ListBoxItemWrapperAutomationPeer.cs
- AuthStoreRoleProvider.cs
- DataFormats.cs
- ZipIOExtraFieldZip64Element.cs
- ChangeProcessor.cs
- TextDocumentView.cs
- AutomationEventArgs.cs
- DataKeyCollection.cs
- DependencyPropertyHelper.cs
- RowCache.cs
- SelectedDatesCollection.cs
- WsiProfilesElementCollection.cs
- dataprotectionpermissionattribute.cs
- CriticalHandle.cs
- TimersDescriptionAttribute.cs
- XsdDuration.cs
- ClosableStream.cs
- MeshGeometry3D.cs
- PackageDigitalSignature.cs
- StreamGeometry.cs
- MergePropertyDescriptor.cs
- PropertyCollection.cs
- EmptyEnumerator.cs
- ChannelOptions.cs
- QueryException.cs
- SubMenuStyle.cs
- Region.cs
- ContextQuery.cs
- Empty.cs
- HttpListenerResponse.cs
- XmlSchemaSet.cs
- AttributeCollection.cs
- UnsafeNativeMethodsPenimc.cs
- SafeBitVector32.cs
- SignedXmlDebugLog.cs
- Base64Encoder.cs
- AssemblyName.cs
- BitmapScalingModeValidation.cs
- BuildManager.cs
- BitmapPalette.cs
- XmlSchemaParticle.cs
- SiteMapNode.cs
- GenericAuthenticationEventArgs.cs
- GridItemPattern.cs
- TreeNodeMouseHoverEvent.cs
- DisableDpiAwarenessAttribute.cs
- RangeValueProviderWrapper.cs
- HttpFileCollection.cs
- CryptoApi.cs
- ToolStripDropDown.cs
- HtmlTable.cs
- ReferencedType.cs
- TaskFileService.cs
- NativeMethods.cs
- Renderer.cs
- ImageListUtils.cs
- ValidateNames.cs
- WmlLabelAdapter.cs
- NGCSerializationManager.cs
- InputScope.cs
- ActivityXRefConverter.cs
- DataTrigger.cs
- PassportIdentity.cs
- CommonRemoteMemoryBlock.cs
- MouseGestureValueSerializer.cs
- GridItemPattern.cs
- ResolveNameEventArgs.cs
- XmlSerializerNamespaces.cs
- ReachSerializableProperties.cs
- DataSourceHelper.cs
- ListParagraph.cs
- ParameterBuilder.cs
- Crc32.cs
- Matrix.cs
- OLEDB_Util.cs
- TextServicesCompartmentEventSink.cs
- QilXmlWriter.cs
- StateDesigner.Layouts.cs
- UnsettableComboBox.cs
- SpellerInterop.cs
- PluralizationServiceUtil.cs
- DataKey.cs
- XmlSchemaAnnotation.cs
- prompt.cs
- DependencyPropertyHelper.cs
- SkinBuilder.cs
- VisualBrush.cs
- ReadOnlyHierarchicalDataSource.cs
- DataGridToolTip.cs
- HtmlTextBoxAdapter.cs