public static Encoding DetectFileEncoding(string fileName)
{
byte[] buf = new byte[12000];
int length;
using (FileStream fstream = File.OpenRead(fileName))
{
length = fstream.Read(buf, 0, buf.Length);
}
Ude.CharsetDetector d = new Ude.CharsetDetector();
d.Feed(buf, 0, length);
d.DataEnd();
return Encoding.GetEncoding(d.Charset);
}
Public Function a()
Dim s(1 To 5, 1 To 5)
For i = 1 To 5
For j = 1 To 5
s(i, j) = CStr(i) + " " + CStr(j)
Next j
Next i
a = s
End Function
function onEdit(event){
var as = event.source.getActiveSheet();
if ((event.source.getActiveRange().getA1Notation()=="A1")&&(as.getName()=="Лист1")&&(event.source.getActiveRange().getValue()===true)){
as.getRange("B1").setValue("Флажок установлен "+formatDateTime(new Date()));
};
};
function formatDateTime(date) {
var dd = date.getDate();
if (dd < 10) dd = '0' + dd;
var mm = date.getMonth() + 1;
if (mm < 10) mm = '0' + mm;
var yy = date.getFullYear() % 100;
if (yy < 10) yy = '0' + yy;
var hh = date.getHours();
if (hh < 10) hh = '0' + hh;
var MM = date.getMinutes();
if (MM < 10) MM = '0' + MM;
var ss = date.getSeconds();
if (ss < 10) ss = '0' + ss;
return dd + '.' + mm + '.' + yy + ' ' + hh + ':'+ MM + ':'+ ss;
}
IMPORTRANGE(ключ_таблицы; диапазон)