diff --git a/docs/standard/exceptions/snippets/how-to-use-specific-exceptions-in-a-catch-block/cpp/catchexception.cpp b/docs/standard/exceptions/snippets/how-to-use-specific-exceptions-in-a-catch-block/cpp/catchexception.cpp deleted file mode 100644 index 124e92de5c416..0000000000000 --- a/docs/standard/exceptions/snippets/how-to-use-specific-exceptions-in-a-catch-block/cpp/catchexception.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// -using namespace System; - -public ref class Employee -{ -public: - Employee() - { - emlevel = 0; - } - - //Create employee level property. - property int Emlevel - { - int get() - { - return emlevel; - } - void set(int value) - { - emlevel = value; - } - } - -private: - int emlevel; -}; - -public ref class Ex13 -{ -public: - static void PromoteEmployee(Object^ emp) - { - //Cast object to Employee. - Employee^ e = (Employee^) emp; - // Increment employee level. - e->Emlevel++; - } - - static void Main() - { - try - { - Object^ o = gcnew Employee(); - DateTime^ newyears = gcnew DateTime(2001, 1, 1); - //Promote the new employee. - PromoteEmployee(o); - //Promote DateTime; results in InvalidCastException as newyears is not an employee instance. - PromoteEmployee(newyears); - } - catch (InvalidCastException^ e) - { - Console::WriteLine("Error passing data to PromoteEmployee method. " + e->Message); - } - } -}; - -int main() -{ - Ex13::Main(); -} -// diff --git a/docs/standard/exceptions/snippets/how-to-use-the-try-catch-block-to-catch-exceptions/cpp/catchexception.cpp b/docs/standard/exceptions/snippets/how-to-use-the-try-catch-block-to-catch-exceptions/cpp/catchexception.cpp deleted file mode 100644 index 93113b49c1b8e..0000000000000 --- a/docs/standard/exceptions/snippets/how-to-use-the-try-catch-block-to-catch-exceptions/cpp/catchexception.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -using namespace System; -using namespace System::IO; - -public ref class ProcessFile -{ -public: - static void Main() - { - try - { - StreamReader^ sr = File::OpenText("data.txt"); - Console::WriteLine("The first line of this file is {0}", sr->ReadLine()); - sr->Close(); - } - catch (Exception^ e) - { - Console::WriteLine("An error occurred: '{0}'", e); - } - } -}; - -int main() -{ - ProcessFile::Main(); -} -//