コード例 #1
0
ファイル: TestExamples.cs プロジェクト: roddickchen/NCDK
 public void TestInchi2InchiKey()
 {
     // START SNIPPET: inchi2inchikey
     NInchiOutputKey output = NInchiWrapper.GetInchiKey("InChI=1S/C2H6/c1-2/h1-2H3");
     string          key    = output.Key;
     // END SNIPPET: inchi2inchikey
 }
コード例 #2
0
 /// <summary>
 /// Gets generated InChIKey string.
 /// </summary>
 public string GetInChIKey()
 {
     try
     {
         var key = NInchiWrapper.GetInchiKey(Output.InChI);
         if (key.ReturnStatus == INCHI_KEY.OK)
         {
             return(key.Key);
         }
         else
         {
             throw new CDKException("Error while creating InChIKey: " + key.ReturnStatus);
         }
     }
     catch (NInchiException exception)
     {
         throw new CDKException("Error while creating InChIKey: " + exception.Message, exception);
     }
 }