C
C#13mo 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
TomyOP13mo 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
wasabi13mo ago
Send a message with what?
Tomy
TomyOP13mo ago
wdym with what with a bot or from my account just send me a message "Ticket available"
wasabi
wasabi13mo ago
There isn't some universal "messaging" concept in the world.
Tomy
TomyOP13mo ago
//send me messenger/instagram/telegram text or any kind of notification?
wasabi
wasabi13mo 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
Thinker13mo ago
btw, you should be using HttpClient instead of WebClient
Tomy
TomyOP13mo ago
Thanks
Want results from more Discord servers?
Add your server