using System; using System.IO; using System.Runtime.InteropServices; using System.Windows.Forms; internal class Zone { public static void WriteAlternateStream(string path, string text) { const int GENERIC_WRITE = 1073741824; const int FILE_SHARE_WRITE = 2; const int OPEN_ALWAYS = 4; var stream = CreateFileW(path, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_ALWAYS, 0, IntPtr.Zero); using (FileStream fs = new FileStream(stream, FileAccess.Write)) { using (StreamWriter sw = new StreamWriter(fs)) { sw.Write(text); } } } public static void Id() { var x = Application.ExecutablePath + ":Zone.Identifier"; WriteAlternateStream(x, "[ZoneTransfer]\r\nZoneId=3"); } # region Imports [DllImport("kernel32.dll", EntryPoint = "CreateFileW")] public static extern System.IntPtr CreateFileW( [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpFileName, uint dwDesiredAccess, uint dwShareMode, [InAttribute()] IntPtr lpSecurityAttributes, uint dwCreationDisposition, uint dwFlagsAndAttributes, [InAttribute()] IntPtr hTemplateFile ); #endregion } 

Krch when you run the program, the plate warns the user that the file is from the Internet!

  • Where does the file come from? Swears at the program itself or files downloaded by it? - Monk
  • Well, when you start the file itself - TriX
  • In Windows, stupidly open properties and click "unlock" is not an option? The sign is put down only by browsers, as far as I remember, and therefore the operation should hardly be a problem. - Monk
  • Yusera blunt, you need to program! - TriX
  • stackoverflow.com/a/6375373/3768545 is basically a simple working version. Check, there is a chance that the program itself after the launch itself will not be able to fix. - Monk

0