c# - How to convert Icon into a base64 string? -


icon icon = icon.extractassociatedicon(_path); 

how convert above icon base64 string in c# ?

first have raw bytes of icon:

var icon = icon.extractassociatedicon(_path); byte[] bytes; using (var ms = new memorystream()) {     icon.save(ms);     return ms.toarray(); } 

then can convert bytes base64 string:

var base64string = convert.tobase64string(bytes); 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -