list - Send some pdf files as email attachments stored in a db in c# -
i need send pdf files email attachments stored in database.
i need convert comma separated string list<string>
, have tried c# code:
if (reader.hasrows) { while (reader.read()) { recoveryatt = reader["att"].tostring(); string commaseplist; string[] itemlist = { recoveryatt.tostring() }; commaseplist = string.join("; ", itemlist); response.write(commaseplist.tostring()); } }
but in output have:
d:\inetpub\wwwroot\app\public\015.pdfd:\inetpub\wwwroot\app\public\016.pdfd:\inetpub\wwwroot\app\public\017.pdfd:\inetpub\wwwroot\app\public\018.pdfd:\inetpub\wwwroot\app\public\019.pdf
and in email attachment first pdf file...
this doesn't work cause returns string[] without separator.
please help.
i think trick
string[] itemlist = regex.split(recoveryatt, @"(?=d:)").where(x => !string.isnullorempty(x)).toarray(); commaseplist = string.join("; ", itemlist); response.write(commaseplist);
Comments
Post a Comment