fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8. }
  9. private void quitToolStripMenuItem_Click(object sender, EventArgs e)
  10. {
  11. Bitmap bm = new Bitmap(this.bmp);
  12. SaveFileDialog SFD = new SaveFileDialog();
  13. SFD.Filter = "Images|*.png;*.bmp;*.jpg";
  14. ImageFormat format = ImageFormat.Png;
  15. if (SFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  16. {
  17. string ext = System.IO.Path.GetExtension(SFD.FileName);
  18. switch (ext)
  19. {
  20. case ".jpg":
  21. format = ImageFormat.Jpeg;
  22. break;
  23. case ".bmp":
  24. format = ImageFormat.Bmp;
  25. break;
  26. }
  27. Thread.Sleep(30);
  28. bm.Save(SFD.FileName, format);
  29. }
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(11,13): error CS0246: The type or namespace name `Bitmap' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(12,13): error CS0246: The type or namespace name `SaveFileDialog' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(13,13): error CS0841: A local variable `SFD' cannot be used before it is declared
prog.cs(14,13): error CS0246: The type or namespace name `ImageFormat' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(15,17): error CS0841: A local variable `SFD' cannot be used before it is declared
prog.cs(17,58): error CS0841: A local variable `SFD' cannot be used before it is declared
prog.cs(17,45): error CS1502: The best overloaded method match for `System.IO.Path.GetExtension(string)' has some invalid arguments
/usr/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
prog.cs(17,45): error CS1503: Argument `#1' cannot convert `object' expression to type `string'
prog.cs(21,34): error CS0103: The name `ImageFormat' does not exist in the current context
prog.cs(21,25): error CS0841: A local variable `format' cannot be used before it is declared
prog.cs(24,34): error CS0103: The name `ImageFormat' does not exist in the current context
prog.cs(24,25): error CS0841: A local variable `format' cannot be used before it is declared
prog.cs(27,17): error CS0103: The name `Thread' does not exist in the current context
prog.cs(28,17): error CS0841: A local variable `bm' cannot be used before it is declared
Compilation failed: 14 error(s), 0 warnings
stdout
Standard output is empty