|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|
|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|
|
Hi,
I am developing a webcrawler/webspider in C#.Net 2005, I am extracting text from web pages through the code below. But the problem is that it only extract text from html pages because asp.net pages does not contain headers like …. So how I extract text from asp.net & php pages.
Code for extracting text from html web pages
S is string which contains the webpage
MatchCollection mPage = Regex.Matches(s, @"((|||||)\s*.+\s*(|||||))", RegexOptions.IgnoreCase);
foreach (Match mP in mPage)
{
StreamWriter i = new StreamWriter(@"C:\WebSpider\index.txt", true);
i.Write(mP.Groups[0].Value.ToString() +"\t"+ u +"\n");
i.Close();
}
|
|
|
|
|
Hi Friends,
Can anyone tell me how can we implement spell check in a web application. My problem is that i have a text area. what all words i enter there should be checked for its correctness.
Vipin
|
|
|
|
|
|
Hi
In my Web Form, I have this code:
<code><HEAD>
<title id="title" runat="server"></title>
</Head></code>
Then in the code-behind file, I set the title of the page dynamically.
My problem is that sometimes, my web form deletes <b>runat="server"</b> property from the <title> tag automatically. Because it deletes the <b>runat </b>property, my page stops working. I manually have to add <b>runat="server"</b> into the <title> again.
So please tell how I can solve this problem.
Thanks
|
|
|
|
|
Just do this in the code behind:
<br />
this.Page.Title = "Your Title Here";<br />
|
|
|
|
|
Or you could do this:
<head>
<title><%= pageTitle %></title>
<head>
and in your codebehind define pageTitle as protected and assign it in the Page_Load event: pageTitle = "the title of my page";
regards,
Mircea
<small>Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.</small>
|
|
|
|
|
Any one please help me to add context menu to a table row. And the menu should not come when right clicking other parts of the page.
|
|
|
|
|
|
Why is it necessary to implement try catches in your source code when there is already page-level and application-level error handling? To me it sounds a bit redundant.
In the page-level and application-level error handling I log the errors (and InnerExceptions) in the DB, email and the event logger.
Thanks
Fuze
|
|
|
|
|
It is good practice to handle exceptions as close to the source as possible. This gives you the opportunity to handle the exception in an intelligent way and resume work if appropriate. If you wait to catch it at the page or applicaiton level it may be too late.
|
|
|
|
|
|
Colin Angus Mackay wrote: writing code that is too defensive and that can actually hide bugs
Agreed. As with anything the trick is know when and how to use the tools you have. What I meant was not to just bubble the exception back up the call stack when it can be handled at the source, especially in the case of a class library. If I can recover from an exception in my library I don't want to make it the responsibility of the calling application.
|
|
|
|
|
Lets say if you accessing a webservice to retrieve party information and that causes an exception what is the most logical thing to do once it is caught? Im logging them at page and application level. Do I just revert the customer back to that same page where the error occurred and lot it or do I transfer the user back to the homepage and log it. Excuse my ignorance Im a novice with regard to error handling. Thank you
Fuze
|
|
|
|
|
How you handle it depends on the application. Without know how your app is desinged to function I would say to return the user to the page with some message indicating what has happened, i.e "Invalid data", "No record found", etc. Give them a chance to correct any entries. If there is nothing for them to correct, then possibly it would be appropriate to return the to the home page.
|
|
|
|
|
|
|
With the try/catch exception handling you can provide 'alternate' solutions to any problem that you anticipate in advance... for example, if the db connection fails, or if the page dosn't load, etc. you can do something else for the user so that they don't see some error page or message... my 2-cents
Nila Fridley
|
|
|
|
|
i want to pass a string from server side to the client side.
can anyone help me by doing so by xmlHttp Object in javscripting.
I had converted the string on server side to xml data first .
string strServerTime;
strServerTime = DateTime.Now.ToString();
strServerTime = "<?xml version='1.0'?><serverTime><time> " + strServerTime + " </time></serverTime>";
StringReader sr = new StringReader(strServerTime);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(sr);
return xmlDoc;
and returned this object to client side .
on client side i had used xmlHttp.responseXML .but now i am not being able to
extract the child node to get the server time value.
can anyone please help me in this. its toooo urgent .
-- modified at 7:39 Wednesday 19th July, 2006
|
|
|
|
|
instead of loading into an xmldoc ,
append it to a string and write it to response like
Response.Write(string)
you can handle the responsetext
as
responsetext[0]
madhumathi.J
|
|
|
|
|
its ok but how to retrieve it on client side that is in javascripting. 
|
|
|
|
|
i want to put the calendar in my asp page but in our toolbox have but that is not suitable for web site,is there a tool it's like button or someting when we click that button it should display the calendar(Web Calander).Can anyone help for this pls.
Thank u
|
|
|
|
|
You can search for some javascript calenders in google. It will server the purpose for you.
Best Regards,
Apurva Kaushal
|
|
|
|
|