langehk
langehk
CC#
Created by Arone on 10/2/2023 in #help
❔ Array mess
Maybe something like this?
int MAX_AMOUNT_OF_RAFFLE_NUMBERS = 5;
int MIN_NUMBER = 1;
int MAX_NUMBER = 60;
List<int> raffleList = new();


for (int i = 0; i < MAX_AMOUNT_OF_RAFFLE_NUMBERS; i++)
{
Console.WriteLine($"Please write a number from {MIN_NUMBER}-{MAX_NUMBER} that you would like to choose.");
var userInput = Console.ReadLine();

_ = int.TryParse(userInput, out int number);
if (number <= MAX_NUMBER && number >= MIN_NUMBER)
{
raffleList.Add(number);
}
else
{
Console.WriteLine("Incorrect value entered");
}
}

raffleList.Sort();

Console.WriteLine(String.Join(",", raffleList));
int MAX_AMOUNT_OF_RAFFLE_NUMBERS = 5;
int MIN_NUMBER = 1;
int MAX_NUMBER = 60;
List<int> raffleList = new();


for (int i = 0; i < MAX_AMOUNT_OF_RAFFLE_NUMBERS; i++)
{
Console.WriteLine($"Please write a number from {MIN_NUMBER}-{MAX_NUMBER} that you would like to choose.");
var userInput = Console.ReadLine();

_ = int.TryParse(userInput, out int number);
if (number <= MAX_NUMBER && number >= MIN_NUMBER)
{
raffleList.Add(number);
}
else
{
Console.WriteLine("Incorrect value entered");
}
}

raffleList.Sort();

Console.WriteLine(String.Join(",", raffleList));
22 replies
CC#
Created by langehk on 7/11/2023 in #help
❔ ConnectionString to Azure SQL Server
I’ve tried that. But then it says invalid auth or something like that. The json formatting you’re referring to is when I copy paste the connection string. Then that happens. I’ve tried many different ways 😅
5 replies
CC#
Created by langehk on 7/9/2023 in #help
❔ Scrape with HtmlAgilityPack
Will try that. Thanks!
7 replies
CC#
Created by langehk on 7/9/2023 in #help
❔ Scrape with HtmlAgilityPack
But there must be a better way than doing this 😄
7 replies
CC#
Created by langehk on 7/9/2023 in #help
❔ Scrape with HtmlAgilityPack
If I do like this I get the prop value I need, however I would also need the line 14 field.
var desc = childNode.SelectSingleNode("./div/div/div/div/span[contains(@class, 'ux-textspans')]").InnerHtml;
var desc = childNode.SelectSingleNode("./div/div/div/div/span[contains(@class, 'ux-textspans')]").InnerHtml;
7 replies