Microsoft web script serialization javascriptserializer registerconverters




















This type was intended to provide serialization and deserialization functionality for AJAX-enabled applications. Specifies that JavaScriptSerializer will not serialize the public property or public field.

This class cannot be inherited. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. Registers a custom converter with the JavaScriptSerializer instance. The following example shows how to register a custom converter with a JavaScriptSerializer instance. This code example is part of a larger example provided for the JavaScriptSerializer class.

You can register one or more custom converters with a JavaScriptSerializer instance by using the RegisterConverters method. When custom converters are registered, JavaScriptSerializer uses the converters both to serialize managed types and to deserialize JSON strings to managed types.

Append datetime. Append " new Date " ;. Append " " ;. GetType ;. ResolveTypeId type ;. Append ':' ;. GetFields BindingFlags. Public BindingFlags.

Instance ;. Append ',' ;. SerializeString fieldInfo. Name , sb ;. SerializeValue SecurityUtils. GetProperties BindingFlags. Instance BindingFlags. GetProperty ;. GetGetMethod ;. SerializeString propInfo.

Key as string ;. Format CultureInfo. InvariantCulture , AtlasWeb. FullName ;. SerializeDictionaryKeyValue key , entry. Value , sb , depth , objectsInUse , serializationFormat ;. SerializeString key , sb ;. SerializeValue value , sb , depth , objectsInUse , serializationFormat ;. Append '[' ;. SerializeValue o , sb , depth , objectsInUse , serializationFormat ;.

Append ']' ;. Append '"' ;. Append HttpUtility. JavaScriptStringEncode input ;. Serialize o , this ;. ResolveTypeId o. Append Serialize dict , serializationFormat ;.



0コメント

  • 1000 / 1000