C# (C Sharp) programming
По всем вопросам- @notxxx1 Реестр РКН: https://clck.ru/3Fk3kb #VRHSZ
Show more📈 Analytical overview of Telegram channel C# (C Sharp) programming
Channel C# (C Sharp) programming (@csharp_ci) in the Russian language segment is an active participant. Currently, the community unites 18 126 subscribers, ranking 7 040 in the Technologies & Applications category and 36 424 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 18 126 subscribers.
According to the latest data from 04 September, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -55 over the last 30 days and by -9 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 14.53%. Within the first 24 hours after publication, content typically collects 7.50% reactions from the total number of subscribers.
- Post reach: On average, each post receives 2 635 views. Within the first day, a publication typically gains 1 360 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 0.
- Thematic interests: Content is focused on key topics such as .net, api, логика, архитектура, string.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“По всем вопросам- @notxxx1
Реестр РКН: https://clck.ru/3Fk3kb
#VRHSZ”
Thanks to the high frequency of updates (latest data received on 05 September, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
Install-Package Cledev.OpenAI
Пример с ChatGPT
var request = new CreateChatCompletionRequest
{
Model = ChatModel.Gpt35Turbo.ToStringModel(),
Stream = true,
MaxTokens = 500,
Messages = new List<ChatCompletionMessage>
{
new("system", "You are a helpful assistant."),
new("user", "Who won the world series in 2020?"),
new("assistant", "The Los Angeles Dodgers won the World Series in 2020."),
new("user", "Where was it played?")
}
};
var completions = client.CreateChatCompletionAsStream(request);
await foreach (var completion in completions)
{
Console.Write(completion.Choices[0].Message?.Content);
}
Пример генерации изображений (Dall-E)
var request = new CreateImageRequest
{
Prompt = "Once upon a time",
Size = ImageSize.Size512x512.ToStringSize(),
ResponseFormat = ImageResponseFormat.B64Json.ToStringFormat(),
N = 1
};
var response = await client.CreateImage(Request);
<img src="@response.Data[0].Url" />
@csharp_ciusing System;
class Program
{
static void Main(string[] args)
{
int num = 5;
int square = 0, cube = 0;
Mul (num, ref square, ref cube);
Console.WriteLine(square + " & " +cube);
Console.ReadLine();
}
static void Mul (int num, ref int square, ref int cube)
{
square = num * num;
cube = num * num * num;
}
}
@csharp_cinums = [-2,1,-3,4,-1,2,1,-5,4]
Вывод: 6
Объяснение: 4,-1,2,1] имеет наибольшую сумму 6.
Ввод: nums = [5,4,-1,7,8]
Вывод: 23
Решение:
public class Solution {
public int MaxSubArray(int[] nums) {
int res = nums[0], sum = nums[0], i = 1;
while (i < nums.Length)
{
if (nums[i] > nums[i] + sum) sum = nums[i];
else sum = nums[i] + sum;
if (sum > res) res = sum;
i++;
}
return res;
}
}
Пишите свое решение в комментариях👇
@csharp_cipublic static void FireAndForget(
this Task task,
Action<Exception> errorHandler = null)
{
task.ContinueWith(t =>
{
if (t.IsFaulted && errorHandler != null)
errorHandler(t.Exception);
},
TaskContinuationOptions.OnlyOnFaulted);
}
Использование:
SendEmailAsync().FireAndForget(
e => Console.WriteLine(e.Message));
2. Повтор
Для повторного выполнения задачи мы можем создать метод Retry, который позволит нам установить максимальное количество попыток и задержку между ними. Он будет работать до выполнения задачи или достижения максимальной попытки.
public static async Task<TResult>
Retry<TResult>(
this Func<Task<TResult>> taskFactory,
int maxRetries,
TimeSpan delay)
{
for (int i = 0; i < maxRetries; i++)
{
try
{
return await taskFactory()
.ConfigureAwait(false);
}
catch
{
if (i == maxRetries - 1)
throw;
await Task.Delay(delay)
.ConfigureAwait(false);
}
}
// не должно достигать этого места
return default(TResult);
}
Использование:
var result = await (
() => GetResultAsync())
.Retry(3, TimeSpan.FromSeconds(1));
3. Действие при сбое
Выполняется в случае возникновения ошибок или исключений при выполнении задачи
public static async Task
OnFailure(this Task task,
Action<Exception> onFailure)
{
try
{
await task.ConfigureAwait(false);
}
catch (Exception ex)
{
onFailure(ex);
}
}
Использование:
await GetResultAsync()
.OnFailure(ex => Console.WriteLine(ex.Message));
4. Установка временного ограничения для выполнения задачи можно использовать в тех случаях, когда необходимо предотвратить длительное выполнение данной задачи (особенно, если задача не может быть отменена токеном).
public static async Task
WithTimeout(this Task task,
TimeSpan timeout)
{
var delayTask = Task.Delay(timeout);
var completedTask = await
Task.WhenAny(task, delayTask)
.ConfigureAwait(false);
if (completedTask == delayTask)
throw new TimeoutException();
await task;
}
Использование:
await GetResultAsync()
.WithTimeout(TimeSpan.FromSeconds(1));
5. Возврат
Периодически бывает необходимо возвращать значение по умолчанию в случае неудачного выполнения задачи.
public static async Task<TResult>
Fallback<TResult>(
this Task<TResult> task,
TResult fallbackValue)
{
try
{
return await task.ConfigureAwait(false);
}
catch
{
return fallbackValue;
}
}
Использование:
var result = await GetResultAsync()
.Fallback("fallback");
▪ Статья
@csharp_ciusing System;
class Program
{
static void Main(string[] args)
{
double num1 = 1.000001;
double num2 = 0.000001;
Console.WriteLine((num1 - num2) == 1.0);
}
}
@csharp_ciusing System;
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("H" + 'I');
Console.WriteLine('h' + 'i');
}
}using System;
using System.Text;
public class Program
{
public static void Main(string[] args)
{
String str = "";
StringBuilder sb1 = new StringBuilder("TechBeamers");
StringBuilder sb2 = new StringBuilder("TechBeamers");
StringBuilder sb3 = new StringBuilder("Welcome");
StringBuilder sb4 = sb3;
if (sb1.Equals(sb2)) str += "1";
if (sb2.Equals(sb3)) str += "2";
if (sb3.Equals(sb4)) str += "3";
String str1 = "TechBeamers";
String str2 = "Welcome";
String str3 = str2;
if (str1.Equals(str2)) str += "4";
if (str2.Equals(str3)) str += "5";
Console.WriteLine(str);
}
}
Ответ