.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

my application is working some time, but some time its not working

Posted By: ram     Posted Date: January 21, 2014    Points:5   Category :C#
my application is working some time, but some time its not working , when i am trying to Display URLs getting from WebBrowser control using c#(4.0).
some time URLs displaying , some times not diplaying.... Please Can you suggest me Why its happening.....


One of friend suggested me that...Use garbage collector in the desktop application the is App.config File.
I tried by enable the garbage False. even though my problem is not yet solved. some time working,but some times not working.

can you help me...

Here is the code...


private void btnSearchFootprint_Click(object sender, EventArgs e)
{
if (curSearchStatus == search_status.SEARCH_STATUS_STOPPED)
{
crifanLib.dgvClearContent(dataGridView1);

needContinueSearch = true;


string searchStr = "";
searchStr += textBox1.Text;
searchStr += getCurSearchTail();

webBrowser1.Navigate(" www.google.com/search?q=" + searchStr);
//initSearchResultGridView();
searchAndParse(searchStr);
}

}


private void searchAndParse(string searchStr)
{
Dictionary queryPara;
Dictionary headerDict;
string curGoogleSearchUrl;
string curSearchRespHtml;
string curReferer;
//string ei = "";

//1. for get cookie and related url
string googleUrl = " www.google.com.hk/";
string tmpRespHtml = crifanLib.getUrlRespHtml(googleUrl);
//processXjs(tmpRespHtml);

//2. do first search
//weight loss site:.edu inurl:blog "post a comment" -"you must be logged in"
// www.google.com.hk/search?newwindow=1&safe=strict&site=&source=hp&q=weight+loss+site%3A.edu+inurl%3Ablog+%22post+a+comment%22+-%22you+must+be+logged+in%22&btnK=Google+Search

// www.google.com.hk/search
//?newwindow=1
//&safe=strict
//&site=
//&source=hp
//&q=weight+loss+site%3A.edu+inurl%3Ablog+%22post+a+comment%22+-%22you+must+be+logged+in%22
//&btnK=Google+Search
string firstGoogleSearchUrl = " www.google.com.hk/search?";
queryPara = new Dictionary();
queryPara.Add("newwindow", "1");
queryPara.Add("safe", "strict");
queryPara.Add("source", "hp");
queryPara.Add("q", searchStr);
queryPara.Add("btnK", "Google Search");

queryPara.Add("site", "");
//queryPara.Add("site", "webhp");

// www.google.com.hk/search?newwindow=1&safe=strict&hl=zh-CN&site=webhp&source=hp&q=unit&btnK=Google+%E6%90%9C%E7%B4%A2


//firstGoogleSearchUrl += crifanLib.quoteParas(queryPara);
firstGoogleSearchUrl += crifanLib.quoteParas(queryPara, false);
// www.google.com.hk/search?newwindow=1&safe=strict&site=&source=hp&q=weight+loss+site%3a.edu+inurl%3ablog+%22post+a+comment%22+-%22you+must+be+logged+in%22&btnK=Google+Search

curReferer = googleUrl;
curGoogleSearchUrl = firstGoogleSearchUrl;

//3. continue to search current page and next page ...
while(needContinueSearch)
{
headerDict = new Dictionary();
headerDict.Add("referer", curReferer);
curSearchRespHtml = crifanLib.getUrlRespHtml(curGoogleSearchUrl, headerDict: headerDict);
//curSearchRespHtml = crifanLib.getUrlRespHtml(curGoogleSearchUrl);

//processXjs(tmpRespHtml);

parseSinglePageHtml(curSearchRespHtml);
if (!needContinueSearch)
{
break;
}

////window.google={kEI:"XZp2UczlE8nYigeK5IHgCg"
////get ei for next page
//if(crifanLib.extractSingleStr(@"window.google={kEI:""(\w+)""", curSearchRespHtml, out ei))
//{

//}

//check need get more page or not
//

Responses
Author: Ashutosh Jha             
Posted Date: January 28, 2014     Points: 20   

Could you please confirm that is it a live version or you are running on local server.

Regards,
Ashutosh Jha
ashutosh741@gmail.com

http://www.tricksroad.com
Author: bhupathy2807             
Posted Date: January 30, 2014     Points: 20   

Hi,

Can you specify the Error Message or Where this error occurs in the above code.
So it might be helpful to identify the error..!

Thanks,
Bhupathy.T

Thanks,

Bhupathy.T




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend