473,322 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

i have created a simple application for web crawl

12
Expand|Select|Wrap|Line Numbers
  1. string url = TextBox2.Text;
  2.         WebClient wc = new WebClient();
  3.         System.Uri URl = new System.Uri(url);
  4.         wc.DownloadFile(URl, "C:\\" + TextBox1.Text + ".html");
  5.         string c = wc.DownloadString(URl).ToString();           
  6.         System.Text.ASCIIEncoding myencode = new System.Text.ASCIIEncoding();
  7.         byte[] bytes = myencode.GetBytes(c);
  8.         MemoryStream ms = new MemoryStream(bytes);
  9.         SqlConnection con = new SqlConnection("Data Source=SANKALPA4\\SQL05;Initial Catalog=VIJAY;Integrated Security=True");
  10.         SqlCommand cmd = new SqlCommand("insert into v values(@byte,@name)", con);
  11.         cmd.Parameters.Add("@byte", SqlDbType.Binary).Value = bytes;
  12.         cmd.Parameters.Add("@name", SqlDbType.VarChar).Value = TextBox1.Text;
  13.         con.Open();
  14.         cmd.ExecuteNonQuery();
  15.         con.Close();
  16.         c=Regex.Replace(c, @"<.*?>", " ");
  17.         c = Regex.Replace(c, @"[^\w,\.@-]", " ");
  18.         c = Regex.Replace(c, @"[0-9]"," ");
  19.         c = Regex.Replace(c, @"[a-z][A-Z]\d"," ");           
  20.         c.ToLower();
  21.         c.Split(' ');
  22.         string[] str = {"google","gmail","telugu","kannada","to","the" };
this is the code i have i want to remove words declares in string array str from string c
Apr 30 '10 #1
1 1744
tlhintoq
3,525 Expert 2GB
TIP: When you first created your question you were asked to wrap your code with [code] tags.

It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.


Original Poster: I have xxx, then do yyy then zzz happens. Here's my code ...
Ok. You know what you have.
What you don't have is a question. Nobody here knows why you posted this since you haven't asked anything, or exception or description of any error messages you are getting. You haven't described anything that is broken, or any 'expected' results versus 'actual' results.
I recommend you read the FAQ about How to ask a good question so the volunteers will be able to help you.
Apr 30 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ben Jones | last post by:
Hi there, I am looking into the ease of implementing the localization/globalization features of .NET using C#. I have a test app which creates a ResourceManager and attempts to load a resource...
0
by: Steve Mauldin | last post by:
Can anyone recommend a good tool to crawl asp pages and make note of which Pages, Images, Includes, Etc. are used on a web site and which pages are not used? I have inherited a website that is...
1
by: Danny | last post by:
I am trying to crawl my site to get a list of links. I am using the regular expressions to get the href tags from the pages and reading the links using xmlhttp module. is there an efficient way...
1
by: Dave | last post by:
Is it possible to crawl a site using ASP & XML HTTP? I know you can hit one link, but how can you go through each link in a page and validate that it returns 200?
18
by: Alan Little | last post by:
Viewed in IE, this page is exactly what I'm trying to do: http://www.holotech.net/links/ Header, two fixed-width columns, and a footer. However, in NS and Opera, the second column slides to...
1
by: Danny | last post by:
I am trying to crawl my site to get a list of all the links. I am using the regular expressions to get the href tags from the pages and reading the source pages using xmlhttp module. Is there...
1
by: Andy Oakey | last post by:
We have written an ASP.NET application in VB connecting to a SQL Server database. It is run across an internal network at a client site, with around 30 users on the site. They open the application...
0
by: MIGUEL | last post by:
Hi all! Be patient because what I'm going to explain all of you it's more than very strange. I've developed a webservice project that contains two classes. One of them is going to act as a...
13
by: Pradeep Vasudevan | last post by:
hai i am a student and need to write a simple web crawler using python and need some guidance of how to start.. i need to crawl web pages using BFS and also DFS... one using stacks and other...
2
by: mahesr | last post by:
Frds, how to crawl a specific word in whole website using php.need which page it has Example: want to crawl a 144 items found,on somepage.html. Pls if u have code pls mail email address...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.