What website is it, if it has a ID super Easy, if not, I will work something out.
Basically, I want to find the number of posts on mpgh and display it as a label.text.
For example my user profile is here:
https://www.mpgh.net/forum/members/378727-ppl2pass.html
And right now i have 209 posts.
Basically, the program will read the source of that page and find this line:
But this will be different for everyone.Code:Total Posts:</span> 209</li>
How would i display the number of post in a label for different users.
What website is it, if it has a ID super Easy, if not, I will work something out.
NextGen1 Edit:
Namespace
[php]
Imports System.Net
Imports System.IO
Imports System.Text.RegularExpressions
[/php]
This should get you the posts of a certain member...Code:Dim Request As HttpWebRequest = HttpWebRequest.Create("https://www.mpgh.net/forum/members/378727-ppl2pass.html") Dim Response As HttpWebResponse = Request.GetResponse() Dim reader As StreamReader = New StreamReader(Response.GetResponseStream) Dim httpContent As String httpContent = reader.ReadToEnd Dim ViewRegEx As New Regex("Total Posts:</span>(?<Views>(.*))</li>") Dim Views As String Views = (Mid$(ViewRegEx.Match(httpContent).Groups("Views").ToString, 1, 46)) label1.text = Views.Replace("</li> <li><span class=""shade"">Posts Per Da", "")
Last edited by NextGen1; 04-18-2010 at 06:39 AM.
ppl2pass (04-18-2010)
how would you get it for different members, not only for me.
what could i replace for this.
MPGH - MultiPlayer Game Hacking - View Profile: ppl2pass
added the namespace, and yes it is A-typical Context reader with Http and XML
Still would like the site, the reason I asked is content will be different, and I don't think it is for mpgh.
@blubb, Good Job
@ppl ,
Ok it is for mpgh , You will need their address link. in this example, short of database access , you won't have that information (unless you use PHP and post , but that's asp.net)
Best bet is to allow the user during setup to add their url
Last edited by NextGen1; 04-18-2010 at 06:50 AM.
i have a good idea.
to make this happen, i will use a webbrowser in vb.net
i will then tell people to login on the webbrowser.
after they login i will take the source of the webpage and find this line:
will this work?Code:<strong>Welcome, <a href="https://www.mpgh.net/forum/members/378727-ppl2pass.html">ppl2pass</a>
Awwwwwwwwwwww I forgot to add the namespaces
MPGH - MultiPlayer Game Hacking - Hack, Hacks, Game Hacks, Combat Arms Hacks, CrossFire Hacks, WarRock Hacks, Knight Online, Counter Strike: Source Hacks, Counterstrike Hacks, BattleField 2 Hacks, Warrock Hacks, World of Warcraft Hacks, Knight Online / 378727 -ppl2pass.html
The only problem is this value.
-----------------------------------------
That should work.
Exactly PPL, that should work fine
at blubb
at NextGen1 or Blubb
would you explain this code as i will try this for the welcome one.
espcially this:Code:Dim ViewRegEx As New Regex("Total Posts:</span>(?<Views>(.*))</li>") Dim Views As String Views = (Mid$(ViewRegEx.Match(httpContent).Groups("Views").ToString, 1, 46)) label1.text = Views.Replace("</li> <li><span class=""shade"">Posts Per Da", "")
how do you know this?Code:(?<Views>(.*))
You can change "(?<Views>(.*))" to whatever you want.
The "(.*)" tells the program, that the string of "Views" can have any length, since we don't what the length is. It can be 4 numbers but also 8. You don't know.
The "?" tells the program, that it should extract the variable between the <> in this case "Views".
In this line of code Regex is started("Views = (Mid$(ViewRegEx.Match(httpContent).Groups("Views") .ToString, 1, 46))")
httpcontent = the text to be searched in...
Views = The variable the amount of views is saved in...
Mid$ extracts a lot of crap. Without mid$ you'd get a lot of other code as result. It basically extract all characters whose are not in the area from 1-46.
Sorry for this crappy English. I have no idea how to say it =P
In computing, regular expressions, also referred to as regex or regexp, provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A regular expression is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as a parser generator or examines text and identifies parts that match the provided specification.
ppl2pass (04-18-2010)
ok ty. i got one more question.
how would you view the page source of a webbrowser?
to make sure the webbrowser is loaded use the following code:Code:dim source as string = webbrowser1.documenttext
readystate.completed is prolly written somehow else, you'll see....Code:While not webbrowser1.readystate = readystate.completed application.doevents end with
ppl2pass (04-18-2010)
this functoin doesnt work.
While not webbrowser1.readystate = readystate.completed
application.doevents
end with
readstate.completed not defined.
also how do you get the url of webbrower1.
Last edited by ppl2pass; 04-18-2010 at 09:38 AM.
how would you be able to find and read this url for each user:
Code:https://www.mpgh.net/forum/members/378727-ppl2pass.html">ppl2passCode:<strong>Welcome, <a href="https://www.mpgh.net/forum/members/378727-ppl2pass.html">ppl2pass</a>.</strong>