QueryStringConverter.CanConvert(Type) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the specified type can be converted to and from a string representation.
public:
virtual bool CanConvert(Type ^ type);
public virtual bool CanConvert (Type type);
abstract member CanConvert : Type -> bool
override this.CanConvert : Type -> bool
Public Overridable Function CanConvert (type As Type) As Boolean
Parameters
Returns
A value that specifies whether the type can be converted.
Examples
The following code shows how to determine whether the QueryStringConverter can convert to and from the specified type.
if (converter.CanConvert(typeof(Int32)))
converter.ConvertStringToValue("123", typeof(Int32));
If (converter.CanConvert(GetType(Int32))) Then
converter.ConvertStringToValue("123", GetType(Int32))
End If
Applies to
Collabora con noi su GitHub
L'origine di questo contenuto è disponibile in GitHub, in cui è anche possibile creare ed esaminare i problemi e le richieste pull. Per ulteriori informazioni, vedere la guida per i collaboratori.