i solved it myself...
I add a code like this. underline marked line.
private void insertWebApplicationInfo()
{
writeLog = new LogWrite();
string txturl = mtextUrl.Text;
var service = SPFarm.Local.Services.GetValue<SPWebService>(string.Empty);
List<ListInfos> AllListInfo = new List<ListInfos>();
foreach(SPWebApplication webApplication in service.WebApplications)
{
string targetSiteURL = webApplication.AlternateUrls[0].Uri.OriginalString;
if (txturl != null && targetSiteURL != null)
{
if (txturl == targetSiteURL)
{
try
{
foreach (SPContentDatabase contentDatabase in webApplication.ContentDatabases)
{
Add this line
1. get text box value
string txturl = mtextUrl.Text;
2. get web application url
string targetSiteURL = webApplication.AlternateUrls[0].Uri.OriginalString;
3. Add if
if (txturl != null && targetSiteURL != null)
{
if (txturl == targetSiteURL)
{
try