Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Tagged Login Example

Why are you using "Select Case True"?
(Sep 20, 2014 04:26 AM)Cairns Wrote:  I knew someone would bring that up.

I always use if and elseif, however I wanted to play with select case true because I seen a thread about it. It's just out of experimentation really, I will always stick with if and elseif though.

Code
http://c2.com/cgi/wiki?VbFlexibleSelectCase
This article talks about it a bit.

There is not a problem with using either in my opinion depending on the purpose. Let me know what you think

I find that quit confusing actually, but i see the use for it with the default value, but "Case Else" could do the same , sort of i suppose.

This maybe a weird and offtop but in my script engine i have an additional 'Option" for Switch Case.

Code
Switch <expr> option <int> {
  Case <expr> { <statements> }
  Case <expr> { <statements> }
  Case <expr> { <statements> }
}

With this param i can change the behavior of my switch case, by default the select case has only one
possible case it takes, with the option 2, this is not the case, it will evaluate all cases and execute those
that have a positive condition, and executes them in that same order.

anyway, thats my 2 cents ^^
(Sep 20, 2014 08:18 AM)NETExplorer Wrote:  This is my response. Take it or leave it
Code
Public Sub ResetCookies()
      Cookies = Nothing
      Cookies = New CookieContainer
End Sub
Can be shortened to this, you don't need to set it to nothing
Code
Public Sub ResetCookies()
      Cookies = New CookieContainer
End Sub

Instead of doing .Close() and .Dispose() with your streams, throw them in a using statement

Code
Dim StreamData As String = String.Empty
Do Until Stream.EndOfStream
    StreamData = Stream.ReadLine
    Data.Append(StreamData)
Loop
There are a couple of things that are redundant with this
1) Why are you setting StreamData to Stream.ReadLine, and then appending StreamData? Why not go straight with ReadLine?
2) Why are you even looping through the stream, use StreamReader.ReadToEnd()
Here is the fix:
Code
Dim StreamData As String = Stream.ReadToEnd()

There are a couple of more things in your code that I personally wouldn't do, but there isn't really a problem with them.

One last thing, why let the user control the retrieval of the token?

This, it's exactly how i would put in my mind, nicely said Pat, couldn't said any better myself. ✌
Hey, Thanks very much for this tutorial. I have wanted to make a program which gets a token for a while.

Anychance you got skype, I may need a little help ? I have been working on it for over 2 days and cant figure it out.
(Sep 24, 2014 09:12 AM)Cairns Wrote:  If you want to get a token from the tagged log-in page, the source I provided will show you how to do that. If you're developing something completely different then I cannot help sadly, I don't have enough free time.

Okay thank you very much for the reply man :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ElementalTreeOct 15, 2014 04:16 AM 11 255 Oct 15, 2014 04:16 AM
Last Post: ElementalTree
[.NET] by Malik157Sep 13, 2014 04:42 PM 2 173 Sep 13, 2014 04:42 PM
Last Post: Malik157
[.NET] by The SurgeonJan 11, 2014 10:30 AM 7 181 Jan 11, 2014 10:30 AM
Last Post: Cairns