import tkinter as tk
root = tk.Tk()
root.geometry('200x100')
frame_outer = tk.Frame(root, bg='blue')
frame_outer.pack(expand=True, fill='both')
frame = tk.Frame(frame_outer, bg='green')
btn1 = tk.Button(frame, text='Button1')
btn2 = tk.Button(frame, text='Button2')
btn1.pack(side='left', padx=5, pady=5)
btn2.pack(side='left', padx=5, pady=5)
frame.pack(side='top', anchor='center')
root.mainloop()
//определяем протокол - HTTP/HTTPS
$proto = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')? 'https': 'http';
//шлем заголовок для "обновления" страницы без пересылки формы.
//все последующие "ручные" обновления страницы будут происходить без отправки формы
header('Location: ' . $proto . '://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['REQUEST_URI']);
exit;
public static void EncryptFile(string inputFile, string outputFile){
using (var rijndael = RijndaelManaged.Create()){
rijndael.GenerateIV();
rijndael.GenerateKey();
using (var inputStream = File.OpenRead(inputFile))
using (var outputStream = new FileStream(outputFile, FileMode.Create, FileAccess.Write))
using (var encStream = new CryptoStream(outputStream, rijndael.CreateEncryptor(), CryptoStreamMode.Write)){
Task.Run(() =>{
double len = inputStream.Length;
while (outputStream.Length < inputStream.Length){
int currentLineCursor = Console.CursorTop;
Console.SetCursorPosition(0, Console.CursorTop);
Console.Write(new string(' ', Console.WindowWidth));
Console.SetCursorPosition(0, currentLineCursor);
Console.Write(String.Format("Завершено на {0}%", Math.Round(((double)outputStream.Length / len * 100), 2)));
Thread.Sleep(100);
}
});
inputStream.CopyTo(encStream);
Console.WriteLine("\nЗавершено!");
}
}
}