Help NPP Cookie

04/30/2014 20:47 hero9910#16
Quote:
Originally Posted by -ToXiiC View Post
foreach(Cookie cookie in request.CookieContainger.getCookies("url"))
{
if(cookie.Name == "NPP")
{
this.NPP = cookie.Value;
break;
}
}
hahah :D simplest way
Ok. you are right
04/30/2014 21:05 -ToXiiC#17
Simplest and better.
04/30/2014 21:47 wa-sta#18
[METHODE TOXIIC] Exec Time:00:00:00.1097790
[METHODE hero9910] Exec Time:00:00:00.1505206

Execution time of 50000 runs.
However single time:
[METHODE TOXIIC] Exec Time:00:00:00.0000281
[METHODE hero9910] Exec Time:00:00:00.0000274

No way is better, both equal in speed at single run times.

Test function:

Quote:
static void Main(string[] args)
{
string res;
var stopWatch1 = new Stopwatch();
var stopWatch2 = new Stopwatch();
TimeSpan executionTime1 = new TimeSpan();
TimeSpan executionTime2 = new TimeSpan();
CookieContainer cookiecontainer = new CookieContainer();
Uri target = new Uri("http://test");
cookiecontainer.Add(new Cookie("test", "testast") { Domain = target.Host });
cookiecontainer.Add(new Cookie("NKK", "###") { Domain = target.Host });
cookiecontainer.Add(new Cookie("NPP", "NPPBLA124214124124") { Domain = target.Host });
for (int i = 0; i < 1; i++)
{
stopWatch1.Start();
foreach (Cookie cookie in cookiecontainer.GetCookies(target))
{
if (cookie.Name == "NPP")
{
res = cookie.Value;
break;
}
}
stopWatch2.Stop();
executionTime1 += stopWatch1.Elapsed;


stopWatch1.Reset();

stopWatch2.Start();
foreach (Cookie cookie in cookiecontainer.GetCookies(target))
{
if (cookie.ToString().Contains("NPP="))
{
res = cookie.ToString().Split(new char[] { '=' })[1];
break;
}
}
stopWatch2.Stop();
executionTime2 += stopWatch2.Elapsed;

stopWatch2.Reset();
}
Console.WriteLine("[METHODE TOXIIC] Exec Time:" + executionTime1);
Console.WriteLine("[METHODE hero9910] Exec Time:" + executionTime2);
Console.ReadLine();
}
04/30/2014 22:12 -ToXiiC#19
Hehe man your code is a full crap

Use this..

request.Proxy = null; // Boost up!

;)

Than you can see how it takes, try this with my method

Btw your NPP grab is bad coded
04/30/2014 22:20 wa-sta#20
Quote:
Originally Posted by -ToXiiC View Post
Simplest and better.
Quote:
Originally Posted by -ToXiiC View Post
Hehe man your code is a full crap

Use this..

request.Proxy = null; // Boost up!

;)

Than you can see how it takes, try this with my method

Btw your NPP grab is bad coded

Its a benchmark script of your function?
Do you even read the code?
04/30/2014 23:38 ToxicData#21
He is just a stupid kid, ignore him wa-sta.
05/01/2014 18:34 -ToXiiC#22
Quote:
Originally Posted by ToxicData View Post
He is just a stupid kid, ignore him wa-sta.
:'( should i cry? u'r ridicolous, over-ego
05/02/2014 03:56 Maurice#23
Quote:
Originally Posted by -ToXiiC View Post
:'( should i cry? u'r ridicolous, over-ego
Hmm Ic.. people get a lil frusty :')

[Only registered and activated users can see links. Click Here To Register...]

Both way's work and both way's seem to be fast enought to not stuck your program, good game nice try next time better..