QueryStringConverter.ConvertValueToString(Object, Type) 方法

定义

将参数转换为查询字符串表示形式。

public:
 virtual System::String ^ ConvertValueToString(System::Object ^ parameter, Type ^ parameterType);
public virtual string ConvertValueToString (object parameter, Type parameterType);
abstract member ConvertValueToString : obj * Type -> string
override this.ConvertValueToString : obj * Type -> string
Public Overridable Function ConvertValueToString (parameter As Object, parameterType As Type) As String

参数

parameter
Object

要转换的参数。

parameterType
Type

要转换的参数的 Type

返回

参数名称和值。

示例

下面的代码演示如何将类型值转换为值的字符串表示形式。

int value = 321;
string strValue = converter.ConvertValueToString(value, typeof(Int32));
Console.WriteLine("the value = {0}, the string representation of the value = {1}", value, strValue);
Dim value As Integer = 321
Dim strValue As String = converter.ConvertValueToString(value, GetType(Int32))
Console.WriteLine("the value = {0}, the string representation of the value = {1}", value, strValue)

适用于