How can i parse oracle tnsname values in c#? -
i have key in webconfig , want values.
<add name="f8connection" connectionstring="data source=(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(sid=prod)));user id=$username;password=$password" providername="oracle" />
ex. need "host" value.
what best way parse ?
thx
i prefer regex.
var host = new regex("host=(?<host>([a-z0-9]+))").match("<add name='f8connection' connectionstring='data source=(description=(address=(protocol=tcp)(host=localhawd1221ost)(port=1521))(connect_data=(sid=prod)));user id=$username;password=$password' providername='oracle' />").groups["host"].value;
Comments
Post a Comment