tutorials.de Buch-Aktion 05/2012
Seite 2 von 2 ErsteErste 12
Like Tree4Danke
ERLEDIGT
NEIN
ANTWORTEN
16
ZUGRIFFE
4052
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #16
    Avatar von Alexander Schuc
    Alexander Schuc Alexander Schuc ist offline admin | crazy-weasel
    tutorials.de Administrator
    Registriert seit
    Aug 2001
    Ort
    Österreich, Stmk, Graz
    Beiträge
    2.783
    Zitat Zitat von Lkjhgf Lkijhgfd Beitrag anzeigen
    Dachte wenn ichs gleich wieder lösch sieht das gar niemand...
    Es gibt da noch sowas wie E-Mail Benachrichtigungen.. (und ja.. für jeden deiner Posts bekam ich eine )

    Wenn du ein eigenes vB Forum zum Testen hast, kannst ja mal mit Wireshark nachsehen was da schlussendlich alles übertragen wird. Dazu würd ich noch JavaScript deaktivieren, da du diese Scripte die in vB laufen ja wohl eh nicht nachbauen willst.. *g*
     
    With the first link the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably.
    Aaron Satie

    Legends... are the spice of the universe, Mr. Data, because they have a way of sometimes coming true.
    Captain Jean-Luc Picard, Stardate ~41294.5

    Tutorials.de chattet. Hier gibts auch .net Support ^^
    Klickt auf chattet und nutzt den Webchat, oder verbindet euch zu irc.tutorials.de - Channel #Tutorials.de

    (moo)blog furred.net // SiteInfo für WP7 // Pastebin für WP7 // BlogEngine.net Extensions

  2. #17
    Lkjhgf Lkijhgfd Lkjhgf Lkijhgfd ist offline Mitglied
    Registriert seit
    Jan 2011
    Beiträge
    19
    Hi,
    heute bin ich wieder dazugekommen etwas weiter zu entwickeln (auch wenn es leider immer noch nicht tut).
    Ich weiss jetzt dank dem IE HTTP Analizer welche Daten genau gesendet werden.

    Nämlich(wilkürliches Forum/Thema...):
    Code :
    1
    
    title=Re%3A+%5B.NET%5D+Problem+mit+Pointer+oder+so+%C3%A4hnlich&message=qwertz&wysiwyg=0&iconid=0&s=&securitytoken=1299541972-2ad858e638eda8c0c6fa5119f0e39f08249dac76&do=postreply&t=1641679&p=13778829&specifiedpost=0&posthash=ba36d4b59e715facf9272795c6c95185&poststarttime=1299541972&loggedinuser=344783&multiquoteempty=&sbutton=Antworten&signature=1&parseurl=1&emailupdate=2

    Währe super wenn jemand die Zeit hätte sich folgenden Code nochmal anzuschauen.

    Code csharp:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    
            private void button1_Click(object sender, EventArgs e)
            {
                string url = "http://board.gulli.com";
                webBrowser1.DocumentText = sendRequest(url);
            }
     
            public string sendRequest(string url)
            {
                //LOGIN
                ASCIIEncoding encoding = new ASCIIEncoding();
                byte[] loginData = encoding.GetBytes("do=login" + "&vb_login_username=" + id01.Text + "&vb_login_password=" + pw01.Text);
                CookieContainer cookieContainer = new CookieContainer();
                
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url + "/login.php?do=login");
                request.CookieContainer = cookieContainer;
                request.Method = "POST";
                request.ContentType = "application/x-www-form-urlencoded";
     
                Stream stream = request.GetRequestStream();
                stream.Write(loginData, 0, loginData.Length);
                stream.Close();
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
     
     
                //GET PLAIN HTML
                request = (HttpWebRequest)WebRequest.Create(url + "/newreply.php?do=newreply&noquote=1&p=13778773");
                request.CookieContainer = cookieContainer;
                request.Method = "GET";
     
                response = (HttpWebResponse)request.GetResponse();
                StreamReader sr = new StreamReader(response.GetResponseStream());
                string sourceCode = sr.ReadToEnd();
                response.Close();
     
     
                // GET POST STRING  
                byte[] postData = encoding.GetBytes(formPostMsg(sourceCode));
     
     
                // SEND POST STRING  
                request = (HttpWebRequest)WebRequest.Create(url + "/newreply.php?do=newreply&noquote=1&p=13778773");
                request.CookieContainer = cookieContainer;
                request.Method = "POST";
                request.ContentType = "application/x-www-form-urlencoded";
                
                stream = request.GetRequestStream();
                stream.Write(postData, 0, postData.Length);
                stream.Close();
                response = (HttpWebResponse)request.GetResponse();
                sr = new StreamReader(response.GetResponseStream());
                sourceCode = sr.ReadToEnd();
                response.Close();
     
     
                //RETURN FINAL HTML TO WEBCONTROL
                return sourceCode;
            }
     
            public string formPostMsg(string sourceCode)
            { 
                ArrayList postValue = new ArrayList();
     
                postValue.Add("title="+"RERERERERERERE");
                postValue.Add("message=" + "messagemessagemessagemessage");
                postValue.Add("wysiwyg=" + "0");
                postValue.Add("iconid=" + "0");
                postValue.Add("s=" + "");
                    string startindex = "<input type=\"hidden\" name=\"securitytoken\" value=\"";
                    int startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    int endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("securitytoken=" + sourceCode.Substring(startIndex, endIndex - startIndex));
                    startindex = "<input type=\"hidden\" name=\"t\" value=\"";
                    startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("t=" + sourceCode.Substring(startIndex, endIndex - startIndex));
                    startindex = "<input type=\"hidden\" name=\"p\" value=\"";
                    startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("p=" + sourceCode.Substring(startIndex, endIndex - startIndex));
                    startindex = "<input type=\"hidden\" name=\"posthash\" value=\"";
                    startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("specifiedpost=" + "");
                postValue.Add("posthash=" + sourceCode.Substring(startIndex, endIndex - startIndex)); 
                    startindex = "<input type=\"hidden\" name=\"poststarttime\" value=\"";
                    startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("poststarttime=" + sourceCode.Substring(startIndex, endIndex - startIndex)); 
                    startindex = "<input type=\"hidden\" name=\"loggedinuser\" value=\"";
                    startIndex = sourceCode.IndexOf(startindex) + startindex.Length;
                    endIndex = sourceCode.IndexOf("\" />", startIndex);
                postValue.Add("loggedinuser=" + sourceCode.Substring(startIndex, endIndex - startIndex)); 
                postValue.Add("multiquoteempty=" + "");
                postValue.Add("sbutton=" + "Antworten");
                postValue.Add("signature=" + "1");
                postValue.Add("parseurl=" + "1");
                postValue.Add("emailupdate=" + "2");
     
                MessageBox.Show(string.Join("&", postValue.ToArray(typeof(string)) as string[]));
                return string.Join("&", postValue.ToArray(typeof(string)) as string[]);
            }
    Geändert von Lkjhgf Lkijhgfd (08.03.11 um 19:41 Uhr)
     

Ähnliche Themen

  1. Nach Login wieder Login, Treiberfehler ?
    Von Crazy_down im Forum Linux & Unix
    Antworten: 4
    Letzter Beitrag: 11.02.08, 00:09
  2. Antworten: 2
    Letzter Beitrag: 08.10.07, 11:38
  3. Antworten: 2
    Letzter Beitrag: 04.09.07, 23:19
  4. Antworten: 1
    Letzter Beitrag: 29.01.05, 12:11
  5. Antworten: 3
    Letzter Beitrag: 12.01.05, 21:14