c# - Base 64 encoding in wp7? -
i have string encode in base64. final encoding saved in string.
in ios :
- (nsstring *)encodecredentials { //string encoded nsstring *deviceuuid = "34543647yrgsav635chbvcew4f56v" nsdata *plaintextdata = [deviceuuid datausingencoding:nsutf8stringencoding]; nsstring *base64string = [plaintextdata base64encodedstring]; //i return encoded string return base64string; }
how in wp7 ?
for encoding:
public string encode(string str) { return convert.tobase64string(system.text.encoding.utf8.getbytes(str)); }
for decoding:
public string decode(string str) { return system.text.encoding.utf8.getstring(convert.frombase64string(str)); }
Comments
Post a Comment