Visual Studio 2010 C#
Posted: Wed Oct 31, 2012 10:06 pm
I have some problems with API. I can' t make it work (build).
I am newb in C#
Code:
Errors:
I am newb in C#
Code:
Code: Select all
public Form1()
{
InitializeComponent();
for (int i = 1; i <= 3; i++)
{
int len = Enigma_IDE.EP_ProtectedStringByID(i, null, 0);
if (len > 0)
{
StringBuilder str = new StringBuilder(len);
if (Enigma_IDE.EP_ProtectedStringByID(i, str, len) > 0)
{
if (i == 1)
encdecpass = str.ToString();
if (File.Exists(Directory.GetCurrentDirectory() + "\\users.ini") == false)
{
File.Create(Directory.GetCurrentDirectory() + "\\users.ini");
IniFile ini = new IniFile(Directory.GetCurrentDirectory() + "\\users.ini");
if (i == 2)
username = str.ToString();
else
password = str.ToString();
}
}
}
}
}
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern Int32 EP_ProtectedStringByID(Int32 ID, StringBuilder Str, Int32 Len);
}Code: Select all
Error 1 The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) C:\******\Visual Studio 2010\Projects\login\login\Form1.cs 47 14 login
Error 2 The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?) C:\******\Visual Studio 2010\Projects\login\login\Form1.cs 47 14 login