VB Questions re C Programming

Discussion in 'ASP .Net' started by Murphy, Apr 18, 2004.

  1. Murphy

    Murphy Guest

    I am new to .Net and am currently learning using vb in a project using
    WebMatrix not Visual Studio.

    I have found an article regarding password security that is written in C
    code and I am unsure of how to implement it into my project.

    I am able to create and compile .vb files and I understand how to include
    code in the aspx and ascx files.

    The article referred to is below and states "The class we presented in
    today's article can be built into your own .NET projects - either directly
    in C# projects or as an assembly in other programming languages." the only
    question is how ?
    http://www.aspheute.com/english/20040105.asp


    Thanks


    Murphy
    Murphy, Apr 18, 2004
    #1
    1. Advertising

  2. Hi, Murphy,

    From the project you will need only the class DotNetGermanUtils.Password
    which is in the file Password.cs. So, first decompress this file to a folder
    of your choise.

    Now you have 2 options - option one, which is the harder one, is to
    translate this to VB.NET.

    Option two is to build this class to a .dll:
    Open the command prompt (Start->Run, type cmd and click OK). Then either add
    to the current path the path to the .NET Framework folder, i.e:

    set path=%path%;C:\Windows\Microsoft.NET\Framework\v1.1.4322\

    or change the current directory to the above one. Depending on the version
    you have the last folder name will be different, take the name from Windows
    Explorer.

    If you have decomressed the file Password.cs to C:\ you can build it like
    this:

    csc /target:library /out:C:\password.dll /r:System.dll C:\Password.cs

    Then just add the .dll file to the bin folder of the web application you are
    intending to use it.

    Hope this helps
    Martin
    "Murphy" <> wrote in message
    news:...
    > I am new to .Net and am currently learning using vb in a project using
    > WebMatrix not Visual Studio.
    >
    > I have found an article regarding password security that is written in C
    > code and I am unsure of how to implement it into my project.
    >
    > I am able to create and compile .vb files and I understand how to include
    > code in the aspx and ascx files.
    >
    > The article referred to is below and states "The class we presented in
    > today's article can be built into your own .NET projects - either directly
    > in C# projects or as an assembly in other programming languages." the only
    > question is how ?
    > http://www.aspheute.com/english/20040105.asp
    >
    >
    > Thanks
    >
    >
    > Murphy
    >
    >
    Martin Dechev, Apr 19, 2004
    #2
    1. Advertising

  3. Murphy

    Murphy Guest

    Martin, you are fantastic...

    Thanks a million

    Murphy

    "Martin Dechev" <> wrote in message
    news:efzw$...
    > Hi, Murphy,
    >
    > From the project you will need only the class DotNetGermanUtils.Password
    > which is in the file Password.cs. So, first decompress this file to a

    folder
    > of your choise.
    >
    > Now you have 2 options - option one, which is the harder one, is to
    > translate this to VB.NET.
    >
    > Option two is to build this class to a .dll:
    > Open the command prompt (Start->Run, type cmd and click OK). Then either

    add
    > to the current path the path to the .NET Framework folder, i.e:
    >
    > set path=%path%;C:\Windows\Microsoft.NET\Framework\v1.1.4322\
    >
    > or change the current directory to the above one. Depending on the version
    > you have the last folder name will be different, take the name from

    Windows
    > Explorer.
    >
    > If you have decomressed the file Password.cs to C:\ you can build it like
    > this:
    >
    > csc /target:library /out:C:\password.dll /r:System.dll C:\Password.cs
    >
    > Then just add the .dll file to the bin folder of the web application you

    are
    > intending to use it.
    >
    > Hope this helps
    > Martin
    > "Murphy" <> wrote in message
    > news:...
    > > I am new to .Net and am currently learning using vb in a project using
    > > WebMatrix not Visual Studio.
    > >
    > > I have found an article regarding password security that is written in C
    > > code and I am unsure of how to implement it into my project.
    > >
    > > I am able to create and compile .vb files and I understand how to

    include
    > > code in the aspx and ascx files.
    > >
    > > The article referred to is below and states "The class we presented in
    > > today's article can be built into your own .NET projects - either

    directly
    > > in C# projects or as an assembly in other programming languages." the

    only
    > > question is how ?
    > > http://www.aspheute.com/english/20040105.asp
    > >
    > >
    > > Thanks
    > >
    > >
    > > Murphy
    > >
    > >

    >
    >
    Murphy, Apr 20, 2004
    #3
  4. Murphy

    Murphy Guest

    Martin, one more question if I may...

    I have compiled the code into a dll in the bin directory of my app however I
    am having problems accessing the functions as there is a function and a
    class that both share the name 'Password' and this is causing errors...

    The code I am trying to use is below 'namespace.class' however when I
    reference the class the compiler is expecting arguments for password as this
    is also a function:
    Dim securitysystem As DotNetGermanUtils.Password = New
    DotNetGermanUtils.Password()
    Dim password as String = securitysystem.CreateRandomPassword(8)
    Dim Salt as Integer = securitysystem.CreateRandomSalt()

    Ther error received is:
    Compiler Error Message: BC30455: Argument not specified for parameter
    'nSalt' of 'Public Sub New(strPassword As String, nSalt As Integer)'.

    Thanks Murphy



    "Martin Dechev" <> wrote in message
    news:efzw$...
    > Hi, Murphy,
    >
    > From the project you will need only the class DotNetGermanUtils.Password
    > which is in the file Password.cs. So, first decompress this file to a

    folder
    > of your choise.
    >
    > Now you have 2 options - option one, which is the harder one, is to
    > translate this to VB.NET.
    >
    > Option two is to build this class to a .dll:
    > Open the command prompt (Start->Run, type cmd and click OK). Then either

    add
    > to the current path the path to the .NET Framework folder, i.e:
    >
    > set path=%path%;C:\Windows\Microsoft.NET\Framework\v1.1.4322\
    >
    > or change the current directory to the above one. Depending on the version
    > you have the last folder name will be different, take the name from

    Windows
    > Explorer.
    >
    > If you have decomressed the file Password.cs to C:\ you can build it like
    > this:
    >
    > csc /target:library /out:C:\password.dll /r:System.dll C:\Password.cs
    >
    > Then just add the .dll file to the bin folder of the web application you

    are
    > intending to use it.
    >
    > Hope this helps
    > Martin
    > "Murphy" <> wrote in message
    > news:...
    > > I am new to .Net and am currently learning using vb in a project using
    > > WebMatrix not Visual Studio.
    > >
    > > I have found an article regarding password security that is written in C
    > > code and I am unsure of how to implement it into my project.
    > >
    > > I am able to create and compile .vb files and I understand how to

    include
    > > code in the aspx and ascx files.
    > >
    > > The article referred to is below and states "The class we presented in
    > > today's article can be built into your own .NET projects - either

    directly
    > > in C# projects or as an assembly in other programming languages." the

    only
    > > question is how ?
    > > http://www.aspheute.com/english/20040105.asp
    > >
    > >
    > > Thanks
    > >
    > >
    > > Murphy
    > >
    > >

    >
    >
    Murphy, Apr 20, 2004
    #4
  5. Hi, Murphy,

    This class has only one constructor that takes 2 parameters. So you should
    first generate the random password and salt and then pass these to the
    constructor. This is how it is done in the TestApplication.cs file - though
    it is in C# the code is quite simple and I'm sure you will understand what
    it does. Moreover, there are comments explaining it.

    So your code should be:

    Dim RandomPassword as String = _
    DotNetGermanUtils.Password.CreateRandomPassword(8)
    Dim RandomSalt as Integer = _
    DotNetGermanUtils.Password.CreateRandomSalt()
    Dim securitysystem As DotNetGermanUtils.Password = _
    New DotNetGermanUtils.Password(RandomPassword, RandomSalt)

    And then calculate the hash etc.

    Hope this helps
    Martin
    "Murphy" <> wrote in message
    news:...
    > Martin, one more question if I may...
    >
    > I have compiled the code into a dll in the bin directory of my app however

    I
    > am having problems accessing the functions as there is a function and a
    > class that both share the name 'Password' and this is causing errors...
    >
    > The code I am trying to use is below 'namespace.class' however when I
    > reference the class the compiler is expecting arguments for password as

    this
    > is also a function:
    > Dim securitysystem As DotNetGermanUtils.Password = New
    > DotNetGermanUtils.Password()
    > Dim password as String = securitysystem.CreateRandomPassword(8)
    > Dim Salt as Integer = securitysystem.CreateRandomSalt()
    >
    > Ther error received is:
    > Compiler Error Message: BC30455: Argument not specified for parameter
    > 'nSalt' of 'Public Sub New(strPassword As String, nSalt As Integer)'.
    >
    > Thanks Murphy
    >
    >
    >
    > "Martin Dechev" <> wrote in message
    > news:efzw$...
    > > Hi, Murphy,
    > >
    > > From the project you will need only the class DotNetGermanUtils.Password
    > > which is in the file Password.cs. So, first decompress this file to a

    > folder
    > > of your choise.
    > >
    > > Now you have 2 options - option one, which is the harder one, is to
    > > translate this to VB.NET.
    > >
    > > Option two is to build this class to a .dll:
    > > Open the command prompt (Start->Run, type cmd and click OK). Then either

    > add
    > > to the current path the path to the .NET Framework folder, i.e:
    > >
    > > set path=%path%;C:\Windows\Microsoft.NET\Framework\v1.1.4322\
    > >
    > > or change the current directory to the above one. Depending on the

    version
    > > you have the last folder name will be different, take the name from

    > Windows
    > > Explorer.
    > >
    > > If you have decomressed the file Password.cs to C:\ you can build it

    like
    > > this:
    > >
    > > csc /target:library /out:C:\password.dll /r:System.dll C:\Password.cs
    > >
    > > Then just add the .dll file to the bin folder of the web application you

    > are
    > > intending to use it.
    > >
    > > Hope this helps
    > > Martin
    > > "Murphy" <> wrote in message
    > > news:...
    > > > I am new to .Net and am currently learning using vb in a project using
    > > > WebMatrix not Visual Studio.
    > > >
    > > > I have found an article regarding password security that is written in

    C
    > > > code and I am unsure of how to implement it into my project.
    > > >
    > > > I am able to create and compile .vb files and I understand how to

    > include
    > > > code in the aspx and ascx files.
    > > >
    > > > The article referred to is below and states "The class we presented in
    > > > today's article can be built into your own .NET projects - either

    > directly
    > > > in C# projects or as an assembly in other programming languages." the

    > only
    > > > question is how ?
    > > > http://www.aspheute.com/english/20040105.asp
    > > >
    > > >
    > > > Thanks
    > > >
    > > >
    > > > Murphy
    > > >
    > > >

    > >
    > >

    >
    >
    Martin Dechev, Apr 20, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward
    Replies:
    1
    Views:
    312
    Raymond Lewallen
    May 25, 2004
  2. Matt
    Replies:
    35
    Views:
    10,566
    George Neuner
    Jul 22, 2004
  3. az
    Replies:
    3
    Views:
    8,217
    Kanenas
    Apr 12, 2005
  4. Casey Hawthorne
    Replies:
    4
    Views:
    986
    Jarek Zgoda
    Aug 4, 2006
  5. Joe Mayo
    Replies:
    168
    Views:
    3,248
    David Thompson
    Oct 22, 2007
Loading...

Share This Page