- 1
int y = (int)Math.Floor((decimal)(block_number / w));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 5
+134
int y = (int)Math.Floor((decimal)(block_number / w));
все переменные - int
+129
if (obj == null)
return 0;
if (obj == DBNull.Value)
return 0;
return int.Parse (obj.ToString ());
в столбце хранится Integer...
+144
Response.Write ("<script>window.open (\"~/DownloadFile.aspx?FileID=" + e.id + "\")</script>");
+118
SqlCommand command = new SqlCommand ();
command.Connection = connection;
command.CommandText = "select data from filestorage where id=@id;";
command.Parameters.AddWithValue ("@id", fileId);
command.CommandType = CommandType.Text;
byte [] data = (byte []) command.ExecuteScalar ();
System.IO.Stream outStream = Response.OutputStream;
Response.ContentType = "Application/octet-stream";
Response.AppendHeader ("Connection", "keep-alive");
Response.AppendHeader ("Content-Disposition", " attachment; filename = \"" + fName+"\"" );
outStream.Write (data, 0, data.Length);
Response.End ();
продолжение http://govnokod.ru/4227
+125
command = new System.Data.SqlClient.SqlCommand();
command.Connection = connection;
command.CommandText = "select data from filestorage where id=@id;";
command.Parameters.AddWithValue("@id", fileId);
command.CommandType = CommandType.Text;
byte[] data = (byte[])command.ExecuteScalar();
command.CommandText = "select filename from filestorage where id=@id;";
string fName = (string)command.ExecuteScalar();
command.CommandText = "select sizebytes from filestorage where id=@id;";
long lngFileSize = (int)command.ExecuteScalar();
command.CommandText = "select foldername from filestorage where id=@id;";
string store= command.ExecuteScalar().ToString();