C
C#8mo ago
Tomy

Send message with c#?

Is there any way to send notification with c#? Im checking for a ticket, and if its available, I want to get a notification.
8 Replies
Tomy
Tomy8mo ago
class Program
{
static void Main(string[] args)
{
while(true)
{
String datum = DateTime.Now.ToString();
WebClient client = new WebClient();
string content = client.DownloadString("https://www.mujegpalya.hu/hu/jegyek");
if (content.Contains("<strong>Hamarosan...</strong>"))
{
Console.WriteLine($"[{DateTime.Now}]Ticket: Soon....");
}
else
{
Console.WriteLine($"[{DateTime.Now}] Ticket: Available");
//send me messenger/instagram/telegram text or any kind of notification?
Thread.Sleep(2000);
Environment.Exit(0);
}
Thread.Sleep(10000);
}

}
}
}
class Program
{
static void Main(string[] args)
{
while(true)
{
String datum = DateTime.Now.ToString();
WebClient client = new WebClient();
string content = client.DownloadString("https://www.mujegpalya.hu/hu/jegyek");
if (content.Contains("<strong>Hamarosan...</strong>"))
{
Console.WriteLine($"[{DateTime.Now}]Ticket: Soon....");
}
else
{
Console.WriteLine($"[{DateTime.Now}] Ticket: Available");
//send me messenger/instagram/telegram text or any kind of notification?
Thread.Sleep(2000);
Environment.Exit(0);
}
Thread.Sleep(10000);
}

}
}
}
wasabi
wasabi8mo ago
Send a message with what?
Tomy
Tomy8mo ago
wdym with what with a bot or from my account just send me a message "Ticket available"
wasabi
wasabi8mo ago
There isn't some universal "messaging" concept in the world.
Tomy
Tomy8mo ago
//send me messenger/instagram/telegram text or any kind of notification?
wasabi
wasabi8mo ago
If you want to send an email, you need an email server, and proper instructions to send an email through that server. If you want to send something through Instragram, you'll have to see if they offer that, and how, from them. If you want to send a telegram message, you'll have to see if they offer that, and how, from them. If you want to send a text message, you'll need some provider that will relay messages to the SMS system, and figure out the costs/instructions from them. Repeat for every distinct thing that exists. I googled for "sending a message through Telegram" and ended up at this page: https://core.telegram.org/bots/api, where they describe their bot API, and how to use it, and what it requires.
Thinker
Thinker8mo ago
btw, you should be using HttpClient instead of WebClient
Tomy
Tomy8mo ago
Thanks
Want results from more Discord servers?
Add your server
More Posts