converting old asp code to asp.net webform

0

Hi i have this dll from an old project that the dll is uses to login but uppon adding the DLL on reference it give's me a reference "AppUser.dll" can't be added, Please make sure that the file is accessible and that it is a valid assembly or COM component. here's the old code using the Dll its written in asp

'/ Create AppUser Object
    set MyUser =Server.CreateObject("AppUser.User") 
    MyUser.UserName=Request.Form("UserName")            'set this first - CANNOT BE OMITTED
    Response.Write(MyUser)


if MyUser.Login("WebApps","AppUsers",Request.Form("UserName"),Request.Form("Password"))=false then

    Session("NumAttempts") = Session("NumAttempts") + 1
        if Application("NumAttempts") = 0 then

so oppon researching i found that i can use DLL import in order to import.

Here's what i tryed

[DllImport("AppUser.User", CharSet = CharSet.Unicode)]
        public static extern bool Login(string webapps, String appuser, String username,string password);
        protected void Page_Load(object sender, EventArgs e)
        {

        }



        protected void btnLogin_ServerClick1(object sender, EventArgs e)
        {
            Session["UserName"] = txtUser.Value;
          bool iscorrect = Login("WebApps", "AppUsers", txtUser.Value, txtpassword.Value);
          if (iscorrect == true)
          {
              Response.Redirect("Home.aspx");
          }
          else
          {

          }
        }

but i get

An exception of type 'System.DllNotFoundException' occurred in WebApps.dll but was not handled in user code

Additional information: Unable to load DLL 'AppUser.User': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

i also try this [DllImport(@"C:\**\****\Documents\projects\WebApps\WebApps\bin\AppUser.User", CharSet = CharSet.Unicode)] but get

An exception of type 'System.DllNotFoundException' occurred in WebApps.dll but was not handled in user code

Additional information: Unable to load DLL 'C:\Users\nx011116\Documents\projects\WebApps\WebApps\bin\AppUser.User': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Can i use that old dll in my new project because the dencryption of password on login is on that dll and that dll is only what we have to use in log in.

c#
asp.net
.net
asp-classic
asked on Stack Overflow Apr 20, 2020 by Kim Ivan Bay-an • edited Apr 20, 2020 by Vadim Kotov

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0