Encoding UTF8 = Encoding.UTF8; Encoding UTF32 = Encoding.UTF32; byte[] unicodeBytes = UTF8.GetBytes(uri.AbsoluteUri.ToString()); byte[] asciiBytes = Encoding.Convert(UTF8, UTF32, unicodeBytes); char[] asciiChars = new char[UTF32.GetCharCount(asciiBytes, 0, asciiBytes.Length)]; UTF32.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0); string asciiString = new string(asciiChars);
private void MainForm_KeyDown(object sender, KeyEventArgs e) { KeyPreview = true; if (e.KeyCode == Keys.F1 && e.KeyCode == Keys.Left) { this.Close(); } }
[WebMethod(EnableSession = true)] public static void deleteuploadedfile() { string[] files = Directory.GetFiles(@"C:\inetpub\wwwroot\sites\eureka\uploaded\"); foreach (string file in files) File.Delete(file); }
function deletefile() { $(document).ready(function () { $.ajax({ type: "POST", url: "Default.aspx/deleteuploadedfile", dataType: "json" }); }); } window.onbeforeunload = deletefile();