Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

Wishingchain

@Wishingchain
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Getting first paragraph of wikipedia using Voice C#
    W Wishingchain

    how would I download it to a stream?

    C# help question csharp php database

  • Getting first paragraph of wikipedia using Voice C#
    W Wishingchain

    I figured out how to use my voice to search for stuff but now I need to get it to Speak the first paragraph...

    C# help question csharp php database

  • Getting first paragraph of wikipedia using Voice C#
    W Wishingchain

    yeah thats basically it..

    C# help question csharp php database

  • Getting first paragraph of wikipedia using Voice C#
    W Wishingchain

    Hi, My name is Wish and I have recently coded an application that recognizes commands I ask it to do(open notepad, gives time, etc.) I now want to be able to ask it a question like "who is Barack Obama" and it will respond with the first paragraph of the wikipedia article. I have this code so far which requires me to manually type in what I want to search for. This is that code

    var webClient = new WebClient();
    var pageSC = webClient.DownloadString("http://en.wikipedia.org/w/api.php?format=xml&action=query&prop=extracts&titles=" + textBox1.Text + "&redirects=true");
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(pageSC);

            var fnode = doc.GetElementsByTagName("extract")\[0\];
            try
            {
                string ss = fnode.InnerText;
                Regex regex = new Regex("\\\\<\[^\\\\>\]\*\\\\>");
                string.Format("Before:{0}", ss);
    
                ss = regex.Replace(ss, string.Empty);
                string result = String.Format(ss);
                richTextBox2.Text = result;
            }
            catch
            {
                richTextBox2.Text = "error";
            }
    

    Any and all help will be greatly appreciated. If this is too vauge of a question please tell me and I will try to explain in more detail.

    Thanks, Wish

    C# help question csharp php database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups