Си диез / Говнокод #29059 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
using System;
using System.Threading;
using System.Diagnostics;

public class ANYRUN_server
{
    private static string application = null;

    public static void Main(string[] args)
    {
        Authorization();
    }
    
    private static void Authorization()
    {
	DateTime today = DateTime.Now;
	
        Console.WriteLine("\"Not business mail users\" registration");
        Console.WriteLine("Please fill out our straightforward application form:");
	application = Console.ReadLine();
	SendApplication(application);
	Thread.Sleep(3600000);
        if (today.Month == 4 && today.Day == 1)
        {
            AcceptApplication();
        }
	else
	{
	    RejectApplication();
	}
    }
	
    private static void SendApplication(string application)
    {
        // Like, who cares about the application?
	application = null;
    }
    
    private static void RejectApplication()
    {
        Console.Write("Hello, after reviewing your application we are unable to provide you with a free personal account. ");
        Console.Write("If you want to check files for malware I recommend using services such as https://opentip.kaspersky.com/ and https://www.virustotal.com/gui/home/upload.");
    }
	
    private static void AcceptApplication()
    {
        Console.WriteLine("Hello, after reviewing your application we decided to provide you with a free personal account.");
	Console.WriteLine("Please, wait for a password...");
	Thread.Sleep(1800000);
	Console.WriteLine("Here's your password: ");
	Thread.Sleep(5000);
	Process.Start("videoplayer.exe", "C:\\Rickrolled.mp4");
    }
}

Исходный код для регистрации пользователей без бизнеспочты в дискорде сайта any.run #meme

BelCodeMonkey BelCodeMonkey, (Updated )

Комментарии (1, +1)

Си диез / Говнокод #28997 Ссылка на оригинал

0

  1. 1
Тип объекта, который инициализируется безумно.

https://learn.microsoft.com/ru-ru/dotnet/api/system.lazy-1?view=net-8.0#--------------
Обожаю автоматический перевод в документации

В оригинале, кстати, вот так:
https://learn.microsoft.com/en-us/dotnet/api/system.lazy-1?view=net-8.0#type-parameters
Заметьте, что ссылка тоже побилась

kezzyhko kezzyhko, (Updated )

Комментарии (3, +3)

Си диез / Говнокод #28985 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
private void UpdateRowInfo()
{
	//код
	if (condition);
	{
		//код
	}
	//код
}

Наткнулся на вот такое в одном проекте. Точка с запятой после if считается пустым statement, а всё что внутри фигурных скобок - просто блок, от if'а независящий. Всё, как IDEшка об этом сообщает - точка с запятой стала серого цвета (на сером фоне, ага). Угадайте, сколько времени искался этот баг

kezzyhko kezzyhko, (Updated )

Комментарии (3, +3)

Си диез / Говнокод #28939 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
/// <summary>
/// перобразуем DateTime? в DateTime, если не получается, то возвращаем текущую дату
/// </summary>
/// <param name="date"></param>
/// <returns></returns>
private DateTime DateTimeHelper(DateTime? date)
{
    try
    {
        return (DateTime)date;
    }
    catch
    {
        return DateTime.Now;
    }
}

reemind reemind, (Updated )

Комментарии (1, +1)

Си диез / Говнокод #28877 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
string[] words = line.Split(' ');
foreach (var word in words)
{
    Console.Write(word);
    switch (word)
    {
        case "11":
            Console.WriteLine($"{tableEng[0, 0]}");
            break;
        case "12":
            Console.WriteLine($"{tableEng[0, 1]}");
            break;
        case "13":
            Console.WriteLine($"{tableEng[0, 2]}");
            break;
        case "14":
            Console.WriteLine($"{tableEng[0, 3]}");
            break;
        case "15":
            Console.WriteLine($"{tableEng[0, 4]}");
            break;
        case "21":
            Console.WriteLine($"{tableEng[1, 0]}");//
            break;
        case "22":
            Console.WriteLine($"{tableEng[1, 1]}");
            break;
        case "23":
            Console.WriteLine($"{tableEng[1, 2]}");
            break;
        case "24":
            Console.WriteLine($"{tableEng[1, 3]}");
            break;
        case "25":
            Console.WriteLine($"{tableEng[1, 4]}");
            break;
        case "31":
            Console.WriteLine($"{tableEng[2, 0]}");
            break;
        case "32":
            Console.WriteLine($"{tableEng[2, 1]}");
            break;
        case "33":
            Console.WriteLine($"{tableEng[2, 2]}");
            break;
        case "34":
            Console.WriteLine($"{tableEng[2, 3]}");
            break;
        case "35":
            Console.WriteLine($"{tableEng[2, 4]}");
            break;
        case "41":
            Console.WriteLine($"{tableEng[3, 0]}");
            break;
        case "42":
            Console.WriteLine($"{tableEng[3, 1]}");
            break;
        case "43":
            Console.WriteLine($"{tableEng[3, 2]}");
            break;
        case "44":
            Console.WriteLine($"{tableEng[3, 3]}");
            break;
        case "45":
            Console.WriteLine($"{tableEng[3, 4]}");
            break;
        case "51":
            Console.WriteLine($"{tableEng[4, 0]}");
            break;
        case "52":
            Console.WriteLine($"{tableEng[4, 1]}");
            break;
        case "53":
            Console.WriteLine($"{tableEng[4, 2]}");
            break;
        case "54":
            Console.WriteLine($"{tableEng[4, 3]}");
            break;
        case "55":
            Console.WriteLine($"{tableEng[4, 4]}");
            break;
    }
    
}
}
Console.ReadLine();

Дело IsBukva живёт.

https://habr.com/ru/articles/771530/

ISO ISO, (Updated )

Комментарии (34, +34)

Си диез / Говнокод #28850 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
public readonly struct Int64 : IComparable<long>, IConvertible, 
IEquatable<long>, IParsable<long>, ISpanParsable<long>, 
System.Numerics.IAdditionOperators<long,long,long>, 
System.Numerics.IAdditiveIdentity<long,long>, 
System.Numerics.IBinaryInteger<long>, System.Numerics.IBinaryNumber<long>, 
System.Numerics.IBitwiseOperators<long,long,long>, 
System.Numerics.IComparisonOperators<long,long,bool>, 
System.Numerics.IDecrementOperators<long>, 
System.Numerics.IDivisionOperators<long,long,long>, 
System.Numerics.IEqualityOperators<long,long,bool>, 
System.Numerics.IIncrementOperators<long>, 
System.Numerics.IMinMaxValue<long>, 
System.Numerics.IModulusOperators<long,long,long>, 
System.Numerics.IMultiplicativeIdentity<long,long>, 
System.Numerics.IMultiplyOperators<long,long,long>, 
System.Numerics.INumber<long>, System.Numerics.INumberBase<long>, 
System.Numerics.IShiftOperators<long,int,long>, 
System.Numerics.ISignedNumber<long>, 
System.Numerics.ISubtractionOperators<long,long,long>, 
System.Numerics.IUnaryNegationOperators<long,long>, 
System.Numerics.IUnaryPlusOperators<long,long>

https://learn.microsoft.com/en-us/dotnet/api/system.int64?view=net-7.0

ISO ISO, (Updated )

Комментарии (43, +43)

Си диез / Говнокод #28847 Ссылка на оригинал

0

  1. 1
  2. 2
public ArgumentException (string? message, string? paramName);
public ArgumentNullException (string? paramName, string? message);

https://learn.microsoft.com/en-us/dotnet/api/system.argumentexception.-ctor?view=net-7.0#system-argumentexception-ctor(system-string-system-string)
https://learn.microsoft.com/en-us/dotnet/api/system.argumentnullexception.-ctor?view=net-7.0#system-argumentnullexception-ctor(system-string-system-string)

ISO ISO, (Updated )

Комментарии (17, +17)

Си диез / Говнокод #28825 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
using System;
using System.Linq;

namespace TheBestGenerator
{
   
    class Symbols
    {
        protected const string Letters = "abcdefghijklmnopqrstuvwxyz";
        protected const string Numbers = "0123456789";
        protected const string DefaultSpecialSymbols = @"!#$%&*@\";
        protected static Random rand = new Random();     
    }
    
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("Введите длину пароля:");
                int Len = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine(Generator.Password(Len));
            }
        }     
    }
   
    class Generator: Symbols
    {
       
        static char[] Array_()
        {
            return (Numbers+Letters+Letters.ToUpper()+DefaultSpecialSymbols).ToCharArray();
        }

         static char[] Password_Symbols()
        {
            return Array_().OrderBy(Symbol => rand.Next()).ToArray();
        }

        public static string Password(int Len )
        {
            char[] password = Password_Symbols();
            Array.Resize(ref password, Len);
            return (string.Join("", password));
        }
    }
}

Генератор паролей. Говнокод с наследованием. Почти ничего не понимаю в нем, но "прогу" с ним написал.

utsutsbabyj utsutsbabyj, (Updated )

Комментарии (1, +1)