title: Convert a C# code to Php using the DOTNET class
body: <p>I'm trying to convert a C# code to php using DOTNET, I never use C# but a lot of php, so, I'm starting with a basic things, to se if usefull do the conversion, then have the next C# piece of code.</p>
  
  <pre><code>using System.Text;
  class AES
  {
      private byte[] _key;
      private byte[] _iv;
      public AES()
      {
      }
      public AES(string keyBase, string iv)
      {
          _key = Encoding.ASCII.GetBytes(keyBase);
          _iv = Encoding.ASCII.GetBytes(iv);
      }
  }
  </code></pre>
  
  <p>then trying to convert just this piece, so I do the next in php</p>
  
  <pre><code>&lt;?php
  class Ejemplo{
      public function FunctionName($value = '')
      {
          echo "Hello world!...";
          //var_dump(\System\Text\Encoding::GetEncoding());
          $stack = new DOTNET("mscorlib", "System.Text.Encoding");
          var_dump($stack);
     }
  }
  $eje = new Ejemplo();
  $eje-&gt;FunctionName('nada');
  ?&gt;
  </code></pre>
  
  <p>but in the line 
  "$stack = new DOTNET("mscorlib", "System.Text.Encoding");" </p>
  
  <p>Got this error "Fatal error: Uncaught exception 'com_exception' with message 'Failed to instantiate .Net object [CreateInstance] [0x80131513]", </p>
  
  <p>then looking for the web, I see that need a full string with version and other things for dll refered to "System.Text.Encoding", my question is how to know the info for a dll, to can create a string like this</p>
  
  <pre><code>$csclass = new DOTNET("CSharpCOM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=beb607ae770f5750", "CSharpCOM.CSharpCOMClass");
  </code></pre>
  
  <p>but for my </p>
  
  <pre><code>$stack = new DOTNET("mscorlib", "System.Text.Encoding");
  </code></pre>
  
  <p>Or if someone know another way to do this. Thanks everybody</p>