Click here to Skip to main content
15,897,315 members
Home / Discussions / C#
   

C#

 
GeneralRe: Invisible Winform Pin
jspoonermso7-May-09 14:57
jspoonermso7-May-09 14:57 
GeneralRe: Invisible Winform Pin
EliottA7-May-09 10:51
EliottA7-May-09 10:51 
GeneralRe: Invisible Winform Pin
jspoonermso7-May-09 11:45
jspoonermso7-May-09 11:45 
GeneralRe: Invisible Winform Pin
Big Daddy Farang7-May-09 12:00
Big Daddy Farang7-May-09 12:00 
AnswerRe: Invisible Winform Pin
jspoonermso7-May-09 12:31
jspoonermso7-May-09 12:31 
GeneralRe: Invisible Winform Pin
SimpleData10-May-09 6:11
SimpleData10-May-09 6:11 
QuestionAutorun checker and exception handling Pin
Rajdeep.NET is BACK7-May-09 9:49
Rajdeep.NET is BACK7-May-09 9:49 
AnswerRe: Autorun checker and exception handling Pin
OriginalGriff7-May-09 10:11
mveOriginalGriff7-May-09 10:11 
This may be a silly question, but is your D: drive by any chance a CD or DVD drive? If so, then deleting files may not be too easy...

Oh, and PLEASE, use the code block button - it makes things easier to read.

If what you are trying to do is handle the error cleanly:
using System;
using System.IO;
class search
   {
   public static void Main()
      {
      Console.WriteLine("Autorun checker");
      if (File.Exists(@"C:\autorun.inf") || File.Exists(@"D:\autorun.inf"))
         {
         Console.WriteLine("Autorun Detected. Press Enter to delete it.");
         Console.ReadLine();
         try
            {
            File.Delete(@"C:\autorun.inf");
            }
         catch (IOException ex)
            {
            Console.WriteLine("Unable to delete C:\\autorun.inf:\n{0}", ex);
            }
         try
            {
            File.Delete(@"D:\autorun.inf");
            }
         catch (IOException ex)
            {
            Console.WriteLine("Unable to delete D:\\autorun.inf:\n{0}", ex);
            }
         Console.WriteLine("Autorun Deleted successfully.");
         Console.ReadLine();
         }
      else
         {
         Console.WriteLine("No Autorun Detected. Press Enter to exit.");
         Console.ReadLine();
         }
      }
   }


No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: Autorun checker and exception handling Pin
Rajdeep.NET is BACK7-May-09 20:23
Rajdeep.NET is BACK7-May-09 20:23 
AnswerRe: Autorun checker and exception handling Pin
fly9047-May-09 10:19
fly9047-May-09 10:19 
AnswerRe: Autorun checker and exception handling Pin
Henry Minute7-May-09 10:27
Henry Minute7-May-09 10:27 
GeneralProbably in vain Pin
Luc Pattyn7-May-09 10:32
sitebuilderLuc Pattyn7-May-09 10:32 
QuestionAccepting user inputs in a console app. Pin
Rajdeep.NET is BACK7-May-09 9:18
Rajdeep.NET is BACK7-May-09 9:18 
AnswerRe: Accepting user inputs in a console app. Pin
Jimmanuel7-May-09 10:02
Jimmanuel7-May-09 10:02 
AnswerRe: Accepting user inputs in a console app. Pin
Dave Kreskowiak7-May-09 10:03
mveDave Kreskowiak7-May-09 10:03 
QuestionBackColor issue with main form and the controls Pin
Blubbo7-May-09 8:50
Blubbo7-May-09 8:50 
AnswerRe: BackColor issue with main form and the controls Pin
buachaill cliste7-May-09 9:17
buachaill cliste7-May-09 9:17 
GeneralRe: BackColor issue with main form and the controls Pin
Blubbo7-May-09 9:26
Blubbo7-May-09 9:26 
GeneralRe: BackColor issue with main form and the controls Pin
Henry Minute7-May-09 10:22
Henry Minute7-May-09 10:22 
AnswerRe: BackColor issue with main form and the controls Pin
Jabbar_espania8-May-09 1:51
Jabbar_espania8-May-09 1:51 
Question[Message Deleted] Pin
Ankit Aneja7-May-09 7:41
Ankit Aneja7-May-09 7:41 
AnswerRe: problem with datatype Pin
Dave Kreskowiak7-May-09 10:01
mveDave Kreskowiak7-May-09 10:01 
QuestionFramework 3.5 AccountManagement Pin
Jacob Dixon7-May-09 7:15
Jacob Dixon7-May-09 7:15 
QuestionHook on right button mouse Pin
teycir7-May-09 6:52
teycir7-May-09 6:52 
AnswerRe: Hook on right button mouse Pin
Dave Kreskowiak7-May-09 7:24
mveDave Kreskowiak7-May-09 7:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.