Click here to Skip to main content
15,890,825 members
Home / Discussions / C#
   

C#

 
AnswerRe: WebMatrix-Following Pin
N a v a n e e t h16-Feb-13 18:00
N a v a n e e t h16-Feb-13 18:00 
GeneralRe: WebMatrix-Following Pin
Bram van Kampen17-Feb-13 14:45
Bram van Kampen17-Feb-13 14:45 
GeneralRe: WebMatrix-Following Pin
N a v a n e e t h17-Feb-13 17:10
N a v a n e e t h17-Feb-13 17:10 
AnswerRe: WebMatrix-Following Pin
Dave Kreskowiak16-Feb-13 18:50
mveDave Kreskowiak16-Feb-13 18:50 
GeneralRe: WebMatrix-Following Pin
Bram van Kampen17-Feb-13 14:50
Bram van Kampen17-Feb-13 14:50 
QuestionWebMatrix Pin
Bram van Kampen16-Feb-13 14:26
Bram van Kampen16-Feb-13 14:26 
AnswerRe: WebMatrix Pin
N a v a n e e t h16-Feb-13 18:01
N a v a n e e t h16-Feb-13 18:01 
QuestionParsing a web page to get just the <p> inner text. Pin
David C# Hobbyist.16-Feb-13 6:49
professionalDavid C# Hobbyist.16-Feb-13 6:49 
I have a method that should extract text between "paragraph" tags. But I am getting css text and javascript code also.

Here is my code(be kind I am self taught).
C#
private static string GetParagraphs(string webPage)
       {
           string subWebPage = webPage;
           int subWebPageStartIndex = 0;
           string paragraph = "";
           string paragraphs = "";
           int startIndex = 0;
           int endIndex = 0;
           while (subWebPageStartIndex < webPage.LastIndexOf("</p>"))
           {
               subWebPage = webPage.Substring(subWebPageStartIndex);
               startIndex = subWebPage.IndexOf("<p>") + 3 + subWebPageStartIndex;
               endIndex = subWebPage.IndexOf("</p>") + subWebPageStartIndex;
               paragraph = webPage.Substring(startIndex, endIndex);
               paragraphs = paragraphs + " " + paragraph; //TODO: Refactor to use StringBuilder class.
               subWebPageStartIndex = endIndex + 4;
               Debug.WriteLine(paragraph);
           }
           return paragraphs;
       }

Maybe You can see where I have messed up.Confused | :confused:
Thank You for taking the time to read this.

Frazzle the name say's it all


Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

John F. Woods
AnswerRe: Parsing a web page to get just the <p> inner text. Pin
N a v a n e e t h16-Feb-13 18:32
N a v a n e e t h16-Feb-13 18:32 
GeneralRe: Parsing a web page to get just the <p> inner text. Pin
David C# Hobbyist.17-Feb-13 1:40
professionalDavid C# Hobbyist.17-Feb-13 1:40 
GeneralRe: Parsing a web page to get just the <p> inner text. Pin
Richard MacCutchan17-Feb-13 2:43
mveRichard MacCutchan17-Feb-13 2:43 
Questionexample for using webrequest and webresopnse Pin
arashmousapour16-Feb-13 2:10
arashmousapour16-Feb-13 2:10 
QuestionRe: example for using webrequest and webresopnse Pin
Richard MacCutchan16-Feb-13 2:33
mveRichard MacCutchan16-Feb-13 2:33 
GeneralRe: example for using webrequest and webresopnse Pin
PIEBALDconsult16-Feb-13 5:57
mvePIEBALDconsult16-Feb-13 5:57 
QuestionError: No value given for one or more required parameters ? Pin
taibc16-Feb-13 1:18
taibc16-Feb-13 1:18 
AnswerRe: Error: No value given for one or more required parameters ? Pin
Eddy Vluggen16-Feb-13 1:37
professionalEddy Vluggen16-Feb-13 1:37 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 1:55
taibc16-Feb-13 1:55 
GeneralRe: Error: No value given for one or more required parameters ? Pin
Eddy Vluggen16-Feb-13 2:05
professionalEddy Vluggen16-Feb-13 2:05 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 3:59
taibc16-Feb-13 3:59 
AnswerRe: Error: No value given for one or more required parameters ? Pin
Abhinav S16-Feb-13 6:27
Abhinav S16-Feb-13 6:27 
GeneralRe: Error: No value given for one or more required parameters ? Pin
taibc16-Feb-13 14:47
taibc16-Feb-13 14:47 
GeneralRe: Error: No value given for one or more required parameters ? Pin
Abhinav S16-Feb-13 22:50
Abhinav S16-Feb-13 22:50 
QuestionC# not release processes Pin
classy_dog15-Feb-13 9:28
classy_dog15-Feb-13 9:28 
AnswerRe: C# not release processes Pin
Eddy Vluggen15-Feb-13 9:47
professionalEddy Vluggen15-Feb-13 9:47 
GeneralRe: C# not release processes Pin
classy_dog15-Feb-13 10:13
classy_dog15-Feb-13 10:13 

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.