Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 6 odgovora
  • 3.817 pregleda

Najnovija ↓

Slanje http poruke uz pomoc C# 17.06.2009. u 08:52 · pre 211 meseci #1
Imam vec postojeci windows servis koji treba dase izmeni,u smislu da omoguci i slanje http poruke...meni treba neka pomoc,ako je neko ranije radio sa http porukama u C# moze li mi pomoci...?
Potpis
Don't worry be happy
Re: Slanje http poruke uz pomoc C# 19.06.2009. u 13:13 · pre 211 meseci #2
au pa nije li toliko teska tema...da nema odgovora?
:(
Potpis
Don't worry be happy
Re: Slanje http poruke uz pomoc C# 19.06.2009. u 14:52 · pre 211 meseci #4
@sallle
Hvala...konacno se neo setio da napise...

Jel mozes mozda neki primercic da postavis kako bi se slala poruka,ka odredistu,koje tek treba da dobijem?
jos jednom velliko hvala!!
Potpis
Don't worry be happy
Re: Slanje http poruke uz pomoc C# 19.06.2009. u 19:48 · pre 211 meseci #5
google >> msdn
Code:

using System;
using System.Net;
using System.Text;
using System.IO;


    public class Test
    {
        // Specify the URL to receive the request.
        public static void Main (string[] args)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create (args[0]);

            // Set some reasonable limits on resources used by this request
            request.MaximumAutomaticRedirections = 4;
            request.MaximumResponseHeadersLength = 4;
            // Set credentials to use for this request.
            request.Credentials = CredentialCache.DefaultCredentials;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse ();

            Console.WriteLine ("Content length is {0}", response.ContentLength);
            Console.WriteLine ("Content type is {0}", response.ContentType);

            // Get the stream associated with the response.
            Stream receiveStream = response.GetResponseStream ();

            // Pipes the stream to a higher level stream reader with the required encoding format. 
            StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);

            Console.WriteLine ("Response stream received.");
            Console.WriteLine (readStream.ReadToEnd ());
            response.Close ();
            readStream.Close ();
        }
    }

/*
The output from this example will vary depending on the value passed into Main 
but will be similar to the following:

Content length is 1542
Content type is text/html; charset=utf-8
Response stream received.
<html>
...
</html>

*/
Potpis
rafforum.rs - Forum Računarskog Fakulteta
Re: Slanje http poruke uz pomoc C# 22.06.2009. u 09:52 · pre 211 meseci #7
Veliko hvala na savetima...

@administrator
Hteo sam da pitam da li je ko radio i kako se koristi ThreadDaily u C#?
Jel mora nova tema ili mogu ovde?
Potpis
Don't worry be happy
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme