Click here to Skip to main content
15,914,943 members
Home / Discussions / C#
   

C#

 
AnswerRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
OriginalGriff29-Jul-18 19:53
mveOriginalGriff29-Jul-18 19:53 
GeneralRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
Member 245846730-Jul-18 16:11
Member 245846730-Jul-18 16:11 
AnswerRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
jschell30-Jul-18 13:02
jschell30-Jul-18 13:02 
GeneralRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
Gerry Schmitz31-Jul-18 12:58
mveGerry Schmitz31-Jul-18 12:58 
GeneralRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
jschell19-Aug-18 6:06
jschell19-Aug-18 6:06 
AnswerRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
Gerry Schmitz31-Jul-18 13:01
mveGerry Schmitz31-Jul-18 13:01 
Questionc# Stream reader text file split line into first side int, and the other side string Pin
Member 1392985029-Jul-18 4:16
Member 1392985029-Jul-18 4:16 
AnswerRe: c# Stream reader text file split line into first side int, and the other side string Pin
OriginalGriff29-Jul-18 6:09
mveOriginalGriff29-Jul-18 6:09 
QuestionCustom control not visible on parent control Pin
Ömer3328-Jul-18 11:30
Ömer3328-Jul-18 11:30 
AnswerRe: Custom control not visible on parent control Pin
Luc Pattyn28-Jul-18 13:17
sitebuilderLuc Pattyn28-Jul-18 13:17 
AnswerRe: Custom control not visible on parent control Pin
OriginalGriff28-Jul-18 20:24
mveOriginalGriff28-Jul-18 20:24 
AnswerRe: Custom control not visible on parent control Pin
Gerry Schmitz31-Jul-18 13:19
mveGerry Schmitz31-Jul-18 13:19 
Questionread text file online c# Pin
Luiz Carlos27-Jul-18 9:40
Luiz Carlos27-Jul-18 9:40 
AnswerRe: read text file online c# Pin
Dave Kreskowiak27-Jul-18 13:47
mveDave Kreskowiak27-Jul-18 13:47 
AnswerRe: read text file online c# Pin
OriginalGriff27-Jul-18 20:19
mveOriginalGriff27-Jul-18 20:19 
GeneralRe: read text file online c# Pin
Gerry Schmitz28-Jul-18 8:00
mveGerry Schmitz28-Jul-18 8:00 
QuestionGetting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 20:58
Wishingchain26-Jul-18 20:58 
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

C#
<pre>  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

AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Pete O'Hanlon26-Jul-18 22:45
mvePete O'Hanlon26-Jul-18 22:45 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 23:57
Wishingchain26-Jul-18 23:57 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 0:06
professionalEddy Vluggen27-Jul-18 0:06 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain27-Jul-18 18:04
Wishingchain27-Jul-18 18:04 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 23:47
professionalEddy Vluggen27-Jul-18 23:47 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain28-Jul-18 1:03
Wishingchain28-Jul-18 1:03 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen28-Jul-18 1:27
professionalEddy Vluggen28-Jul-18 1:27 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
CP_Member88829-Jul-18 19:25
CP_Member88829-Jul-18 19:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.