Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- FrameworkContentElement.cs
- Ipv6Element.cs
- DeploymentExceptionMapper.cs
- MsmqChannelListenerBase.cs
- UntrustedRecipientException.cs
- DataGridViewCellStateChangedEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- safelinkcollection.cs
- PolicyStatement.cs
- TrustLevelCollection.cs
- ProfileProvider.cs
- HtmlWindowCollection.cs
- XPathChildIterator.cs
- PageCodeDomTreeGenerator.cs
- ValidationRuleCollection.cs
- TextEvent.cs
- UserControlParser.cs
- GridViewEditEventArgs.cs
- InstanceContextManager.cs
- webclient.cs
- datacache.cs
- BufferedOutputAsyncStream.cs
- PasswordPropertyTextAttribute.cs
- UpdateExpressionVisitor.cs
- ThousandthOfEmRealDoubles.cs
- PropertyGridDesigner.cs
- MappingException.cs
- CellParagraph.cs
- StrongNameMembershipCondition.cs
- webclient.cs
- ListView.cs
- SecurityUtils.cs
- DesignerTextWriter.cs
- VectorAnimationBase.cs
- Monitor.cs
- EntityDataSourceState.cs
- SQLSingle.cs
- StylusPointCollection.cs
- ControlAdapter.cs
- InputChannelBinder.cs
- StateItem.cs
- SafeNativeMethods.cs
- TimelineGroup.cs
- BooleanSwitch.cs
- RealizationContext.cs
- TdsParserStateObject.cs
- Range.cs
- NavigationProperty.cs
- XmlElement.cs
- StreamGeometry.cs
- ReversePositionQuery.cs
- Point3DKeyFrameCollection.cs
- Point4D.cs
- EditorPartDesigner.cs
- MenuItemStyleCollection.cs
- AnnotationResourceCollection.cs
- AutomationEvent.cs
- XmlExpressionDumper.cs
- TableCellAutomationPeer.cs
- PropertyInfoSet.cs
- BaseWebProxyFinder.cs
- ListViewItemCollectionEditor.cs
- AdRotator.cs
- CodeLinePragma.cs
- PublisherIdentityPermission.cs
- QueryContinueDragEvent.cs
- cache.cs
- AudioBase.cs
- ContentControl.cs
- PropertyPathConverter.cs
- EmissiveMaterial.cs
- OleDbDataAdapter.cs
- TextRangeAdaptor.cs
- FreezableCollection.cs
- HWStack.cs
- clipboard.cs
- XmlDataSourceNodeDescriptor.cs
- PolicyException.cs
- BuildResultCache.cs
- XmlSchemaAppInfo.cs
- ObjectStateFormatter.cs
- WorkflowDesignerMessageFilter.cs
- Soap.cs
- StandardOleMarshalObject.cs
- JapaneseCalendar.cs
- BackStopAuthenticationModule.cs
- PartialCachingAttribute.cs
- SubMenuStyle.cs
- UnknownBitmapEncoder.cs
- OleDbCommandBuilder.cs
- DataPagerFieldItem.cs
- MonthChangedEventArgs.cs
- StaticSiteMapProvider.cs
- MonthChangedEventArgs.cs
- XmlRootAttribute.cs
- CommandLibraryHelper.cs
- StackSpiller.Generated.cs
- ReflectEventDescriptor.cs
- PropertyInfoSet.cs
- BuildManagerHost.cs