i have created a simple application for web crawl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vj4u
    New Member
    • Apr 2010
    • 12

    i have created a simple application for web crawl

    Code:
    string url = TextBox2.Text;
            WebClient wc = new WebClient();
            System.Uri URl = new System.Uri(url);
            wc.DownloadFile(URl, "C:\\" + TextBox1.Text + ".html");
            string c = wc.DownloadString(URl).ToString();           
            System.Text.ASCIIEncoding myencode = new System.Text.ASCIIEncoding();
            byte[] bytes = myencode.GetBytes(c);
            MemoryStream ms = new MemoryStream(bytes);
            SqlConnection con = new SqlConnection("Data Source=SANKALPA4\\SQL05;Initial Catalog=VIJAY;Integrated Security=True");
            SqlCommand cmd = new SqlCommand("insert into v values(@byte,@name)", con);
            cmd.Parameters.Add("@byte", SqlDbType.Binary).Value = bytes;
            cmd.Parameters.Add("@name", SqlDbType.VarChar).Value = TextBox1.Text;
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            c=Regex.Replace(c, @"<.*?>", " ");
            c = Regex.Replace(c, @"[^\w,\.@-]", " ");
            c = Regex.Replace(c, @"[0-9]"," ");
            c = Regex.Replace(c, @"[a-z][A-Z]\d"," ");           
            c.ToLower();
            c.Split(' ');
            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
    Last edited by tlhintoq; Apr 30 '10, 02:26 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    TIP: When you first created your question you were asked to wrap your code with [code] tags.
    [imgnothumb]http://files.me.com/tlhintoq/10jihf[/imgnothumb]
    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.


    Originally posted by OriginalPoster
    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.

    Comment

    Working...