object[] arr = new object[]
{
"Hello World!",
new object[]
{
"Hello_1",
"Hello_2"
}
};
foreach (object item in arr)
{
if (item is string str)
{
Console.WriteLine(str);
}
else if (item is object[] subarr)
{
foreach (object subitem in subarr)
{
Console.WriteLine(subitem);
}
}
}
object[] arr = new object[]
{
"Hello World!",
new object[]
{
"Hello_1",
"Hello_2",
new object[]
{
"Hello_11",
"Hello_22"
}
}
};
foreach (object item in arr)
{
ItemAction(item, str => Console.WriteLine(str));
}
static void ItemAction(object item, Action<string> action)
{
if (item is string str)
{
action(str);
}
else if (item is object[] arr)
{
foreach (object subitem in arr)
{
ItemAction(subitem, action);
}
}
}
Если других способов нет, то что еще можно использовать для Сида, что бы рандом был правда хорошим, а не таким какой он есть по умолчанию.
Знание или гугление?
string content = Resources.ResourceManager.GetString("filename")
'password,
$stmt = mysqli_prepare($connect, "INSERT INTO `bd` (`id`, `name`, `tel`) VALUES (NULL, ?, ?)");
mysqli_stmt_execute($stmt, [$_POST['name'], $_POST['tel']]);
function prepared_query($mysqli, $sql, $params, $types = "")
{
$types = $types ?: str_repeat("s", count($params));
$stmt = $mysqli->prepare($sql);
$stmt->bind_param($types, ...$params);
$stmt->execute();
return $stmt;
}
$sql = "INSERT INTO `bd` (`name`, `tel`) VALUES (?,?)";
prepared_query($connect, $sql, [$_POST['name'], $_POST['tel']]);
4. Как я могу обезопасить себя от возможной кражи сайта и доменного имени регистратором?
2. Как я могу обезопасить себя от возможной кражи сайта и доменного имени фирмой