DataProtection.EncryptString Method
Encrypts a specified string.
Namespace: Microsoft.VisualStudio.Data.Services
Assembly: Microsoft.VisualStudio.Data.Services (in Microsoft.VisualStudio.Data.Services.dll)
Syntax
'宣言
Public Shared Function EncryptString ( _
s As String _
) As String
'使用
Dim s As String
Dim returnValue As String
returnValue = DataProtection.EncryptString(s)
public static string EncryptString(
string s
)
public:
static String^ EncryptString(
String^ s
)
public static function EncryptString(
s : String
) : String
Parameters
s
Type: System.StringA string to encrypt.
Return Value
Type: System.String
Returns the encrypted string.
Exceptions
Exception | Condition |
---|---|
CryptographicException | The encryption failed. |
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.