首页  编辑  

二进制数据读写

Tags: /C#/注册表读取/   Date Created:

using Microsoft . Win32;

RegistryKey vRegistryKey = Registry . CurrentUser . OpenSubKey(

    @".DEFAULT" , true );

byte [] vBuffer = Encoding . UTF8 . GetBytes( "Zswang );

vRegistryKey . SetValue( "Binary" , vBuffer, RegistryValueKind . Binary);

vBuffer = ( byte [])vRegistryKey . GetValue( "Binary" );

MessageBox . Show( Encoding . UTF8 . GetString(vBuffer));