- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
public static IEnumerable fGetPostIMAP(string port, int port2, string username, string password, string startCount, string path)
{
Stopwatch swatch = new Stopwatch();
swatch.Start();
int Delay = 10;
System.IO.StreamWriter sw = null;
System.Net.Sockets.TcpClient tcpc = null;
int bytes = -1;
int is_file = 0;
int is_att = 0;
byte[] buffer;
StringBuilder sb = new StringBuilder();
//...
string UID = "";
string From;
try
{
//...
if (ListMessage.IndexOf("filename=") > -1)
{
temp = ListMessage.Replace("filename=", "");
temp = temp.Trim();
file_name = temp;
is_file = 1; temp = ""; is_att = 1;
}
//...
if (is_file == 1)
{
if (ListMessage.IndexOf("--") > -1)
end_file = 1;
else
temp = temp + ListMessage;
}
if (ListMessage == "")
{
is_file = 1;
}
//...
}
catch (Exception ex)
{
rows.Add(new object[] { "ERROR:" });
rows.Add(new object[] { ex.Message });
}
finally
{
if (sw != null)
{
sw.Close();
sw.Dispose();
}
if (tcpc != null)
{
tcpc.Close();
}
}
return rows;
}
Делфи головного мозга просвечивает в каждой строчке. Даже использованием 0/1 вместо булева типа не скрыть дельфишной сути.
Хуйню написал. Ловеркейс в переменных и параметрах (не в стиле VCL), обилие фигурных скобок вокруг одиночных операторов (на паскалях begin/end обычно влом писать, где можно обойтись без них), инициализация переменных при объявлении вызовом конструктора, нихуя на Delphi непохоже.
Ты такой смешной глупый нуб, тебе еще столько всего предстоит узнать о программировании
Без цифр, да.
А что не так с инициализацией вызовом конструктора?
bool? не не слышал
http://wiki.freepascal.org/Coding_style
Keywords
Write all keywords in lower case. There is no need to make them unreadble by writing them in upper case. Modern IDEs support syntax highlighting, so keywords will be easily recognizable.
Spaces
Don't use spaces around operators, colons, parentheses etc. e.g. write p:=p+i; instead of p := p + i ;.
TAB characters
Do not use TAB characters (ASCII HT, 0x09). There is no standard default TAB setting, so the look of source files using TAB characters will depend on client settings. This may result in a chaotic view of source files. Align by space characters (also see Indentation).
Indentation
Indentation size is always 2 space characters per level.
Never place a begin on the same line as while..do/if..then/..., but always on its own line (and indent it compared to the while/if/...).
Newlines
Newlines are set as it is done by most Object Pascal programs (what does this mean? advice: avoid passive voice). Separate subroutines by three newlines, that is, put two blank lines between them.
Фраза только для паскалистов. Сишник не пройдёт.