Search This Blog

Wednesday, December 24, 2014

C# System.Security AccessControl

C# > System.Security > AccessControl

With AccessControl you can control, access and audit security related actions on securable objects.









    C# > System.Security

    C# > System.Security

    • NET Framework security system
    • provide access to authentication
    • provide crytographic services
    • control access to operations based on policy
    • rights management of application-created content
    Classes





      Friday, December 19, 2014

      Dynamic Type C# Example

      C# > Types > dynamic

      The dynamic enables bypass compile-time type checking. These operations are resolved at run time. 
      Example

      dynamic dyn = 1;
      object obj = 1;

      var dyn_type = dyn.GetType(); // System.Int32
      var obj_type = obj.GetType(); // System.Int32

      dyn = dyn + 1; //Ok
      obj = obj + 1; // Error    1      Operator '+' cannot be applied to operands of type 'object' and 'int'








      Object Type C# Example

      C# > Types > object

       You can assign values of any type to variables of type object

      Example

      object obj;
      obj = 1; 
      string type =  obj.GetType().Name; //Int32
         
      obj = "string";
      type = obj.GetType().Name; //String








      Thursday, December 18, 2014

      Dns Get Host By Name C# Example

      C# > System.Net > Dns

      Retrieves information about a specific host from the Internet Domain Name System (DNS).

      Example

        IPHostEntry hostInfo = Dns.GetHostByName("www.microsoft.com");
        string hostName = hostInfo.HostName;
        IPAddress[] addressList = hostInfo.AddressList;
        foreach (IPAddress ipAddress in addressList)
        {
                    

        }










      Monday, December 15, 2014

      C# System.Net

      C#System.Net

      Provides  programming interface for:

      • network protocols
      • cache policies
      • e-mail
      • network traffic data and network address information
      • networking functionality
      Classes:
      Namespaces










      STR SQL Server Example

      SQL Server > Built-in Functions > STR

      Converts number to varchar.


      STR ( expression , length , decimal )
      
      
      Example:

      SELECT STR(123.45, 6, 1);

      GO

      result
       123.5