One of the objectives of Exam 70-536 isImplementing interoperability, reflection, and mailing functionality in a .NET Framework applicationCall unmanaged DLL functions within a .NET Framework application, and control the marshalling of data in a .NET Framework application.There are several subtopics in this requirement. The example presented today will coverCreate a class to hold DLL functions;Create prototypes in managed codeCall a DLL functionCall a DLL function in special cases, such as pa... Read Full Story
In this example we are going to touch on two objectives of the 70-536 exam.Implementing globalization, drawing, and text manipulation functionality in a .NET Framework applicationRegex classMatchCollection classImplementing serialization and input/output functionality in a .NET Framework applicationFileStream classStreamReader classTo show these classes in use we are going to count the number of vowels in 25 popular search terms (popular according to Lycos) These strings are included in a lin... Read Full Story
One of the objectives in Exam 70-536 is to ensure knowledge formatting dates. Specifically in theImplementing globalization, drawing, and text manipulation functionality in a .NET Framework application section, we seeFormat date and time values based on the cultureThe .NET framework makes this task pretty straight forward with the System.Globalization namespace. Within this name space there is the CultureInfo class. The CultureInfo class contains all of the specific formatting rules for a ... Read Full Story
I can think of many occasions when I have been diagnosing an issue on a customer machine and I find myself opening the task manager to gather valuable information about the application under question. If the customer will allow it, I will usually take the task manager one step further and use the Process Explorer from SysInternals.But there has to be a better way, your application should be able to grab that information without using another application. And in fact it can by using the Syste... Read Full Story
If you have spent time debugging, you probably know you can click any code line to add a break point. If you have spent some more time you have probably even figured out how to set conditional breakpoints, as Sara Ford explains in this "tip of the day".But did you know you can also cause a break point to trigger from within your code? It is actually pretty easy using the Debugger class within the System.Diagnostics name space. I learned about the Debugger class while looking over th... Read Full Story
After a long hiatus... getting back in the writing zone....Within the "Embedding configuration, diagnostic, management, and installation features into a .NET Framework application" section of Exam 70-536 we are instructed to "Implement IConfigurationSystem Interface".This seemed like a fairly straight forward task so I immediately looked up the interface in the MSDN docs. However, upon reading about the interface, I think someone goofed. The documentation specifically sa... Read Full Story
One of the objectives of the MCTS .NET Framework exam is toEmbed management information and events into a .NET Framework application. (Refer System.Management namespace)and within that exam objective there is the specific objectiveRetrieve information about all network connections.I started to look through the System.Management namespace and found the ManagementObject and the ManagementObjectSearcher. Then the clarity of the examples of the descriptions and examples began to muddy. I unders... Read Full Story
Perhaps you have a need to read from a system event log. Perhaps you have even found the System.Diagnostics namespace. Upon inspecting the EventLog class you will notice a "Write" method but the absence of a complimentary "Read" operation. You are not going crazy, there really isn't a read method.Instead you need to understand a little more about the EventLog object. The entire contents of an EventLog are read in when the EventLog is constructed (if the variant with ... Read Full Story
Have you ever started to type 'by' while writing code in Visual Studio and seen both an upper case and lower case "byte" in the intellisense menu and wondered what the difference was?Lower case "byte" is a built in type in C#. System.Byte is a class built into the .NET framework that represents a byte. The secret is that this built in type is an alias to the System.Byte class. Different .NET languages have different aliases based on the semantics of the particular ... Read Full Story
A stack is a specialized list data structure that enforces LIFO (last in, first out) ordering of data. Thinking of a stack as a physical stack of plates (and data items as the plates), you can only take the last plate that you added to the stack.The stack data structure is among the most useful structures in Computer Science. Stack usage appears at all levels of programming, from operating system kernels to high level languages like those in the .NET framework. Saying that a stack is usefu... Read Full Story