These are practice questions for the Microsoft Technology Specialist (TS) 70-536 Exam 70-210 developed for students and learners. There is a list of 40 questions. You can try these as a timed practice exam. The pass percentage is set to 75% for this set of practice questions. So, let's try out the quiz. All the best!
Exception e = new Exception('Invalid argument'); e.HResult = 0x80070057; throw e;
Return Marshal.GetExceptionForHR(0x8007005);
Throw new ArgumentException('Invalid Argument');
Marshal.ThrowExceptionForHR(0x80070057);
Rate this question:
Signtool
Gacutil
Sn
Tlbimp
Regasm
Rate this question:
EventLog log = new EventLog(); log.Source = "A1"; log.Log = "A2"; log.WriteData("data");
EventLog log = new EventLog(); log.Source = "A2"; log.Log = "A1"; log.WriteEvent("data");
EventLog log = new EventLog(); log.Source = "A1"; log.Log = "A2"; log.WriteEntry("data");
EventLog log = new EventLog(); log.Source = "A2"; log.Log = "A1"; log.WriteError("data");
Rate this question:
Caspol
Permview
Sn
Gacutil
Rate this question:
BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(obj, outstream);
BinaryFormatter formatter = new BinaryFormatter(obj); formatter.Serialize(outstream);
BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(outstream, obj);
BinaryFormatter formatter = new BinaryFormatter(outstream); formatter.Serialize(obj);
Rate this question:
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
Debug.Listeners.Add(new StreamWriter(Console.Out));
Debug.Listeners.Add(new ConsoleTraceListener(Console.Out));
Debug.Listeners.Add(new StreamWriterTraceListener(Console.Out));
Rate this question:
IComparable
IComparer
IEquatable
IEqualityComparer
Rate this question:
WindowsIdentity user = WindowsIdentity.GetCurrent(); if (user.IsInRole("FavouriteUsers")) { //execute code }
WindowsGroup group = WindowsPrincipal.GetGroup("FavouriteUsers"); WindowsIdentity user = WindowsIdentity.GetCurrent(); if (group.Contains(user)) { //execute code }
If (Thread.CurrentPrincipal.IsInRole("FavouriteUsers")) { //execute code }
If (Thread.CurrentUser.IsMemberOf("FavouriteUsers")) { //execute code }
Rate this question:
FileSecurity permission = src.GetAccessControl(); permission.SetAccessRuleProtection(true, false); dst.SetAccessControl(permission);
FileSecurity permission = src.GetAccessControl(); permission.SetAccessRuleProtection(true, true); dst.SetAccessControl(permission);
FileSecurity permission = src.GetAccessControl(); permission.SetAccessRuleProtection(false, false); dst.SetAccessControl(permission);
FileSecurity permission = src.GetAccessControl(); permission.SetAccessRuleProtection(false, true); dst.SetAccessControl(permission);
Rate this question:
[UrlIdentityPermission(SecurityAction.RequestRefuse, Url="http://myintranet")]
[UrlIdentityPermission(SecurityAction.LinkDemand, Url="http://myintranet")]
[UrlIdentityPermission(SecurityAction.Demand, Url="http://myintranet")]
[UrlIdentityPermission(SecurityAction.Assert, Url="http://myintranet")]
Rate this question:
AppDomain ad = AppDomain.Current;
AppDomain ad = Thread.GetDomain();
AppDomain ad = Thread.CurrentThread.CurrentDomain;
AppDomain ad = AppDomain.GetCurrentDomain();
Rate this question:
Hash.Compute(byteArray);
Hash.ComputeHash(byteArray);
Hash = new HashAlgorithm(byteArray); hash.Compute();
Hash = new HashAlgorithm(byteArray); hash.ComputeHash();
Rate this question:
MailMessage msg = new MailMessage(); msg.From = "[email protected]"; msg.To = "[email protected], [email protected]"; msg.Subject = "..."; msg.Body = "..."; SmtpClient client = new SmtpClient(); client.Send(msg);
MailMessage msg = new MailMessage("[email protected]", "[email protected]"); msg.CC.Add(new MailAddress("[email protected]")); msg.Subject = "..."; msg.Body = "..."; SmtpClient client = new SmtpClient(); client.Send(msg);
MailMessage msg = new MailMessage("[email protected]", "[email protected]"); msg.CC.Add(new MailAddress("[email protected]")); msg.Subject = "..."; msg.Body = "..."; SmtpClient client = new SmtpClient(); msg.Send(client);
MailMessage msg = new MailMessage(); msg.From = "[email protected]"; msg.To = "[email protected], [email protected]"; msg.Subject = "..."; msg.Body = "..."; SmtpClient client = new SmtpClient(); msg.Send(client);
Rate this question:
StringCollection
HybridDictionary
HashTable
ArrayList
Rate this question:
Add the NonSerialized attribute to the Salary field.
Have the Employee class implement ISerializable, and in the GetObjectData method, don't persist the Salary field.
Do nothing. since Salary is a private field.
Have the Employee class implement IFormatter for customizing the serialization process.
Rate this question:
If (parameter < 0) MessageBox.Show("parameter cannot be less than 0");
#if DEBUG if (parameter < 0) MessageBox.Show("parameter cannot be less than 0"); #endif
Debug.Assert(parameter >= 0, "parameter cannot be less than 0");
If (parameter < 0) Debug.Assert("parameter cannot be less than 0");
Rate this question:
Read
Write
Seek
Lock
Unlock
Rate this question:
Try { table.Add(key, value); } catch (Exception e) { //key already exists }
If (table.Contains(key)) //key exists
If (table.ContainsKey(key)) //key exists
If (!table.TryAdd(key, value)) //key exists
Rate this question:
Must not have any parameters (void)
Must not return anything (void)
Must take a StreamingContext parameter
Must return a StreamingContext object
Rate this question:
Void Compress(Stream sourceFile, Stream destFile) { GZipStream compStream = new GZipStream(destFile, CompressionMode.Compress); int theByte = sourceFile.ReadByte(); while (theByte != -1) { compStream.WriteByte((byte)theByte); theByte = sourceFile.ReadByte(); } compStream.Flush(); }
Void Compress(Stream sourceFile, Stream destFile) { GZipStream compStream = new GZipStream(sourceFile, CompressionMode.Compress); int theByte = compStream.ReadByte(); while (theByte != -1) { destFile.WriteByte((byte)theByte); theByte = compStream.ReadByte(); } destFile.Flush(); }
Void Compress(Stream sourceFile, Stream destFile) { DeflateStream compStream = new DeflateStream(destFile, CompressionMode.Compress); int theByte = sourceFile.ReadByte(); while (theByte != -1) { compStream.WriteByte((byte)theByte); theByte = sourceFile.ReadByte(); } compStream.Flush(); }
Void Compress(Stream sourceFile, Stream destFile) { DeflateStream compStream = new DeflateStream(sourceFile, CompressionMode.Compress); int theByte = compStream.ReadByte(); while (theByte != -1) { destFile.WriteByte((byte)theByte); theByte = compStream.ReadByte(); } destFile.Flush(); }
Rate this question:
MailMessage.IsSubjectHtml = true;
Set HTML content in the MailMessage.Subject field.
MailMessage.IsBodyHtml = true;
Set HTML content in the MailMessage.Body field.
Rate this question:
SmtpClient.EnableEncryption = true;
SmtpClient.UseEncryption = true;
=SmtpClient.EnableSsl = true;
SmtpClient.UseSsl = true;
Rate this question:
BinaryFormatter
StreamingContext
ObjectManager
SerializationInfo
Rate this question:
Class MyService : System.ServiceProcess.WindowsService { //implementation }
Class MyService : System.ServiceProcess.ServiceHost { //implementation }
Class MyService : System.ServiceProcess.ServiceBase { //implementation }
Class MyService : System.ServiceProcess.Service { //implementation }
Rate this question:
Pass the command like argumeny "MyTrace:enabled" to your application.
Define a BooleanSwitch named "MyTrace" in the application configuration file, and set its value to "1".
Add a registry key named "MyTrace" in the appropriate location, and set its value to "1".
Prompt the user for the value of "MyTrace".
Rate this question:
Create custom classes that inherit from GenericIdentity and GenericPrincipal
Create objects of type GenericIdentity and GenericPrincipal
Create objects of type WindowsIdentity and WindowsPrincipal
Create custom classes that implement IIdentity and IPrincipal
Create custom classes that implement IWindowsIdentity and IWindowsPrincipal
Rate this question:
ServiceController
ServiceHost
ServiceManager
ServiceMonitor
ServiceBase
Rate this question:
Foreach (Process p in Process.GetRunningProcesses()) MessageBox.Show(p.ProcessName);
Foreach (Process p in Process.GetCurrentProcesses()) MessageBox.Show(p.ProcessName);
Foreach (Process p in Process.GetProcesses()) MessageBox.Show(p.ProcessName);
Foreach (Process p in Process.GetUserProcesses()) MessageBox.Show(p.ProcessName);
Rate this question:
Void StartTimer() { Timer myTimer = new Timer(new TimerCallback(MyFunction), null, 600000, 0); }
Void StartTimer() { Timer myTimer = new Timer(new TimerCallback(MyFunction), null, 0, 600000); }
Void StartTimer() { Timer myTimer = new Timer(new TimerCallback(MyFunction), null, 600000, 600000); }
Void StartTimer() { Timer myTimer = new Timer(new TimerCallback(MyFunction), null, 1, 600000); }
Rate this question:
IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("filename", FileMode.Create, userStore); StreamWriter sw = new StreamWriter(stream); sw.WriteLine("user settings"); sw.Close();
IsolatedStorageFile userStore = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("filename", FileMode.Create, userStore); StreamWriter sw = new StreamWriter(stream); sw.WriteLine("user settings"); sw.Close();
IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("filename", FileMode.Create, userStore); IsolatedStorageFileStreamWriter sw = new IsolatedStorageFileStreamWriter(stream); sw.WriteLine("user settings"); sw.Close();
IsolatedStorageFile userStore = IsolatedStorageFile.GetMachineStoreForAssembly(); IsolatedStorageFileStream stream = new IsolatedStorageFileStream("filename", FileMode.Create, userStore); IsolatedStorageFileStreamWriter sw = new IsolatedStorageFileStreamWriter(stream); sw.WriteLine("user settings"); sw.Close();
Rate this question:
String inFileName = "input file path"; string outFileName = "encrypted file path"; FileStream inFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream outFile = new FileStream(outFileName, FileMode.OpenOrCreate, FileAccess.Write); SymmetricAlgorithm myAlg = new RijndaelManaged(); myAlg.GenerateKey(); byte[] fileData = new byte[inFile.Length]; inFile.Read(fileData, 0, (int)inFile.Length); ICryptoTransform encryptor = myAlg.CreateEncryptor(); CryptoStream encryptStream = new CryptoStream(outFile, encryptor, CryptoStreamMode.Write); encryptStream.Write(fileData, 0, fileData.Length); encryptStream.Close(); inFile.Close(); outFile.Close();
String inFileName = "input file path"; string outFileName = "encrypted file path"; FileStream inFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream outFile = new FileStream(outFileName, FileMode.OpenOrCreate, FileAccess.Write); SymmetricAlgorithm myAlg = new RijndaelManaged(); myAlg.GenerateKey(); byte[] fileData = new byte[inFile.Length]; ICryptoTransform encryptor = myAlg.CreateEncryptor(); CryptoStream encryptStream = new CryptoStream(inFile, encryptor, CryptoStreamMode.Read); encryptStream.Read(fileData, 0, inFile.Length); outFile.Write(fileData, 0, (int)fileData.Length); encryptStream.Close(); inFile.Close(); outFile.Close();
String inFileName = "input file path"; string outFileName = "encrypted file path"; FileStream inFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream outFile = new FileStream(outFileName, FileMode.OpenOrCreate, FileAccess.Write); SymmetricAlgorithm myAlg = new RijndaelManaged(); myAlg.GenerateKey(); byte[] fileData = new byte[inFile.Length]; inFile.Read(fileData, 0, (int)inFile.Length); ICryptoTransform encryptor = myAlg.CreateEncryptor(); CryptoStream encryptStream = new CryptoStream(outFile, encryptor, CryptoStreamMode.Read); encryptStream.Write(fileData, 0, fileData.Length); encryptStream.Close(); inFile.Close(); outFile.Close();
String inFileName = "input file path"; string outFileName = "encrypted file path"; FileStream inFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream outFile = new FileStream(outFileName, FileMode.OpenOrCreate, FileAccess.Write); SymmetricAlgorithm myAlg = new RijndaelManaged(); myAlg.GenerateKey(); byte[] fileData = new byte[inFile.Length]; ICryptoTransform encryptor = myAlg.CreateEncryptor(); CryptoStream encryptStream = new CryptoStream(inFile, encryptor, CryptoStreamMode.Write); encryptStream.Read(fileData, 0, inFile.Length); outFile.Write(fileData, 0, (int)fileData.Length); encryptStream.Close(); inFile.Close(); outFile.Close();
Rate this question:
RSACryptoServiceProvider myRsa = new RSACryptoServiceProvider(); byte[] messageBytes = Encoding.Unicode.GetBytes(messageString); myRsa.Encrypt(messageBytes); byte[] encryptedBytes = new byte[messageBytes.Length]; myRsa.GetEncryptedBytes(encryptedBytes);
RSACryptoServiceProvider myRsa = new RSACryptoServiceProvider(); byte[] messageBytes = Encoding.Unicode.GetBytes(messageString); byte[] encryptedMessage = myRsa.Encrypt(messageBytes, false);
RSACryptoServiceProvider myRsa = new RSACryptoServiceProvider(); byte[] messageBytes = Encoding.Unicode.GetBytes(messageString); myRsa.Read(messageBytes); byte[] encryptedBytes = new byte[messageBytes.Length]; myRsa.Write(encryptedBytes);
RSACryptoServiceProvider myRsa = new RSACryptoServiceProvider(); byte[] encryptedMessage = myRsa.Encrypt(messageString, false);
Rate this question:
ConnectionOptions DemoOptions = new ConnectionOptions(); DemoOptions.Username = "username"; DemoOptions.Password = "password"; ManagementScope DemoScope = new ManagementScope("machinename", DemoOptions); ObjectQuery DemoQuery = new ObjectQuery("SELECT Size, Name FROM Win32_LogicalDisk where DriveType=3"); ManagementObjectSearcher DemoSearcher = new ManagementObjectSearcher(DemoScope, DemoQuery); ManagementObjectCollection AllObjects = DemoSearcher.Get(); foreach (ManagementObject DemoObject in AllObjects) { Console.WriteLine("Resource Name: " + DemoObject["Name"].ToString()); Console.WriteLine("Resource Size: " + DemoObject["Size"].ToString()); }
ConnectionOptions DemoOptions = new ConnectionOptions(); DemoOptions.Username = "username"; DemoOptions.Password = "password"; ManagementScope DemoScope = new ManagementScope("machinename", DemoOptions); ObjectQuery DemoQuery = new ObjectQuery("SELECT Size, Name FROM Win32_LogicalDisk where DriveType=3"); ManagementObjectSearcher DemoSearcher = new ManagementObjectSearcher(DemoScope, DemoQuery); ManagementObjectCollection AllObjects = DemoSearcher.Get(); foreach (ManagementObject DemoObject in AllObjects) { Console.WriteLine("Resource Name: " + DemoObject.Name); Console.WriteLine("Resource Size: " + DemoObject.Size); }
ConnectionOptions DemoOptions = new ConnectionOptions(); DemoOptions.Username = "username"; DemoOptions.Password = "password"; ManagementScope DemoScope = new ManagementScope("machinename", DemoOptions); ManagementObjectQuery DemoQuery = new ManagementObjectQuery("SELECT Size, Name FROM Win32_LogicalDisk where DriveType=3"); ManagementObjectSearcher DemoSearcher = new ManagementObjectSearcher(DemoScope, DemoQuery); ManagementObjectCollection AllObjects = DemoSearcher.Get(); foreach (ManagementObject DemoObject in AllObjects) { Console.WriteLine("Resource Name: " + DemoObject.Name); Console.WriteLine("Resource Size: " + DemoObject.Size); }
ConnectionOptions DemoOptions = new ConnectionOptions(); DemoOptions.Username = "username"; DemoOptions.Password = "password"; ManagementScope DemoScope = new ManagementScope("machinename", DemoOptions); ManagementObjectQuery DemoQuery = new ManagementObjectQuery("SELECT Size, Name FROM Win32_LogicalDisk where DriveType=3"); ManagementObjectSearcher DemoSearcher = new ManagementObjectSearcher(DemoScope, DemoQuery); ManagementObjectCollection AllObjects = DemoSearcher.Get(); foreach (ManagementObject DemoObject in AllObjects) { Console.WriteLine("Resource Name: " + DemoObject["Name"].ToString()); Console.WriteLine("Resource Size: " + DemoObject["Size"].ToString()); }
Rate this question:
GetSubDirectories
GetDirectories
GetFileSystemInfos
GetFiles
Rate this question:
Specify the encoding in the StreamWriter constructor
Set the encoding using the StreamWriter.Encoding property.
Set the encoding using the StreamWriter.SetEncoding method
Set the encoding using the StreamWriter.CodePage property
Rate this question:
Dictionary>;
List;
StringDictionary;
NameValueCollection
Rate this question:
IEnumerable
IEnumerator
ICollection
IList
Rate this question:
ITypeConverter
ITypeConvertible
IConvertible
IConverter
Rate this question:
Font ' The Font class has a method that understands a string description of a font
FontConverter
FontConvertible
FontType
Rate this question:
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.