|
You last visited: Today at 22:00
Advertisement
[VB]Check Given Thanks
Discussion on [VB]Check Given Thanks within the .NET Languages forum part of the Coders Den category.
07/06/2012, 04:29
|
#1
|
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,981
|
[VB]Check Given Thanks
Hello everyone, I am here looking for some help as I haven't been really able to figure this out even though I have tried for a while...
I've been trying to figure how to read if a user has thanked a post or not, this is for a software I intend on releasing soon on another section of these forums, but I don't understand german so checking on the links that talk about this just helps a bit because well...using a translator from German to English (or Spanish, my main language) always gives a lot of issues, plus on some threads users simply delete their posts after they have figured it out, so still I have no answer for this matter.
So if anyone could point me out on a way to read this I would greatly appreciate it because even though I have been developing different desktop applications for a while, when it comes to read information from websites or getting something to work through a web service, I haven't been able to figure that out.
Thanks in advance for any hint given.
|
|
|
07/06/2012, 10:21
|
#2
|
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
|
Hey,
best way would be if you check first the users hwid and then look with the epvp*api for their username.
After that you should get the page source of the article, and parse the html until you have only!! the content of thanks from the first!! post.
And then simply check if the content contains the username.
For parsing take this  . It's the most robust solution.
|
|
|
07/06/2012, 20:50
|
#3
|
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
|
|
|
|
07/06/2012, 21:03
|
#4
|
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,981
|
I checked over that thread plus the given links there, everything, unfortunately is in german, got the codes and such yet I don't want something already done, I want to understand how to do it myself, as well as that with the rude way in which the thread starter deleted all of his/her posts you get to understand half of the thread...that is the reason of me actually asking here
|
|
|
07/06/2012, 21:21
|
#5
|
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
|
You shouldnt get something, that's already done  But  may help you to find the right direction.
|
|
|
07/06/2012, 21:36
|
#6
|
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,981
|
Was reading through that one, but if I get it correctly that is mostly for the conversion to lowercase, isn't it?
My issue is that I haven't been able -yet- to use webservices on any of my programs, and the first one I want to get working is basically this one, have been reading a lot about this and tried but seems like there is something I am not getting right, anyways will keep trying to get this done, first on a simple application just to get if maybe all the information of a user, then I'll need to figure how to get it just to check some specific post to see if the person using the software has thanked that post, but need to understand how to get that whole information first
|
|
|
07/07/2012, 15:15
|
#7
|
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
|
hello, did you tried to download the main page, and look up ? i know itīs not the best and comfortable solution but it should give u the result u want
here is a code that i used one time
Code:
Public Sub Content()
Dim content__1 As String
Dim oRequest As WebRequest = WebRequest.Create("the site.html)
oRequest.Credentials = CredentialCache.DefaultCredentials
Dim oResponce As HttpWebResponse = DirectCast(oRequest.GetResponse(), HttpWebResponse)
Dim oStream As Stream = oResponce.GetResponseStream()
Dim oReader As New StreamReader(oStream)
content__1 = oReader.ReadToEnd()
Dim myFile As New StreamWriter("C:/result.dat")
myFile.Write(content__1)
myFile.Close()
oReader.Close()
oStream.Close()
oResponce.Close()
System.IO.File.SetAttributes("C:/result.dat", FileAttributes.Hidden + FileAttributes.ReadOnly)
End Sub
Code:
Dim r As New StreamReader("C:/result.dat")
Dim temp As String = r.ReadToEnd()
If temp.Contains(UserName.Text) And Not UserName.Text = "" Then
TextBox1.Text = "Allowed. Press start !"
Button1.Enabled = True
Else
TextBox1.Text = "Not Allowed. Press 'Thanks' to use the hack !"
Button1.Enabled = False
End If
|
|
|
07/07/2012, 16:13
|
#8
|
elite*gold: 40
Join Date: Apr 2012
Posts: 673
Received Thanks: 83
|
@comment above me
But with your code you look through the whole page for the username. What if he has written a comment under the thread? You should only take the usernames that thanked the thread.
|
|
|
07/07/2012, 16:25
|
#9
|
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
|
as i said itīs not comfortable but he can split the downloaded code, to the part where it says: "The following Users thanked this post:" till something like this </a>
|
|
|
07/07/2012, 16:37
|
#10
|
elite*gold: 40
Join Date: Apr 2012
Posts: 673
Received Thanks: 83
|
Quote:
Originally Posted by XxharCs
as i said itīs not comfortable but he can split the downloaded code, to the part where it says: "The following Users thanked this post:" till something like this
|
Yeah I know but I thought I should tell him that this is the whole page. So it isn't ready with that. Yes he has to split this but wouldn't this be easy to crack? Although I think nobody would crack a program if you only have to thank the post  but for learning it would be good to try to make it safer. I'm not sure maybe something like getting the thanks with php and writing them cryptet to a file and then taking the file decrypting the string and checking whether it contains the username...?! ^^ other question: there isn't another way, right?
|
|
|
All times are GMT +1. The time now is 22:02.
|
|