Results 1 to 9 of 9

Thread: Security in vb.net project

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2012
    Posts
    17

    Post Security in vb.net project

    How can you implement ip address security in vb project.

    I am into a project which should check users ip address and then allow access only if the ip address is present in the dump(authentic ip addresses).

    Please do help me with the code.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Security in vb.net project

    I'm afraid that you're being a bit optimistic expecting code for such a vague question. You've basically provided the general answer yourself: get the user's IP address, check whether it's in the list of valid values and allow access only if it is. If you want specific details of the implementation then you're going to have to provide some specific details about the application. For a start, we don't even know whether it's a web site or web service.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2012
    Posts
    17

    Post Re: Security in vb.net project

    Quote Originally Posted by jmcilhinney View Post
    I'm afraid that you're being a bit optimistic expecting code for such a vague question. You've basically provided the general answer yourself: get the user's IP address, check whether it's in the list of valid values and allow access only if it is. If you want specific details of the implementation then you're going to have to provide some specific details about the application. For a start, we don't even know whether it's a web site or web service.
    Hi,

    Lets say that this ip address 192.168.1.1 is authentic and is in the list. How do I include the group of all authentic ip addresses in my project. If found authentic, can I use a if condition with the ip address(192.168.1.1 in the example)as the condition. What should be the CONDITION in the IF STATEMENT.
    Thanks in advance.

    Regards,
    Asaad

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Security in vb.net project

    Are you potentially going to want to change the list after deployment without having to rebuild the application?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2012
    Posts
    17

    Post Re: Security in vb.net project

    Quote Originally Posted by jmcilhinney View Post
    Are you potentially going to want to change the list after deployment without having to rebuild the application?

    Hi,
    No, I was just giving the example, as you asked for it. Please do tell me how to store a list of authentic ip addresses in vb.net project and check for a ip address to be authentic (present in the list).

    Thanks in advance.

    Asaad

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Security in vb.net project

    I didn't ask for an example. I asked for specific information about the application. See here:
    If you want specific details of the implementation then you're going to have to provide some specific details about the application. For a start, we don't even know whether it's a web site or web service.
    I'm not going to waste my time providing a solution that could easily be completely irrelevant to your actual scenario. There are lots of different ways it could be done but the best way depends on various factors, the first among them being what type of application it is. When you hold back information and fail to answer specific questions asked by those trying to help you, you seriously reduce your chances of getting the help you want.

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2012
    Posts
    17

    Post Re: Security in vb.net project

    Quote Originally Posted by jmcilhinney View Post
    I didn't ask for an example. I asked for specific information about the application. See here:I'm not going to waste my time providing a solution that could easily be completely irrelevant to your actual scenario. There are lots of different ways it could be done but the best way depends on various factors, the first among them being what type of application it is. When you hold back information and fail to answer specific questions asked by those trying to help you, you seriously reduce your chances of getting the help you want.
    Hi,

    My application is a vb.net windows form application which does record management. The project is almost complete but the ip security aspect of it is not. I have a list of authentic ip addresses in excel sheet (the computer ip addresses who will be using the application from office). I want only these ip addresses be allowed access and other users from home or somewhere else should not be allowed access. Ca this be implemented in vb.net. Please do help with code.

    Thanks in advance.

    Asaad

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Security in vb.net project

    Thank you for providing a clear explanation of the problem. Please do so up front in future.

    You'll want the data somewhere that the user can't tamper with it. That would mean either an external location with encryption or else embedding as a resource. The second option is easier. Add a String on the Resources page of the project properties containing a delimited list of valid IP addresses. You can then get that String from My.Resources at run time and Split it into an array. You can get the current IP address using the Dns class and then simply check whether the array Contains that address.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2012
    Posts
    17

    Post Re: Security in vb.net project

    Quote Originally Posted by jmcilhinney View Post
    Thank you for providing a clear explanation of the problem. Please do so up front in future.

    You'll want the data somewhere that the user can't tamper with it. That would mean either an external location with encryption or else embedding as a resource. The second option is easier. Add a String on the Resources page of the project properties containing a delimited list of valid IP addresses. You can then get that String from My.Resources at run time and Split it into an array. You can get the current IP address using the Dns class and then simply check whether the array Contains that address.
    Hi,

    Thanks for the solution. This is what I needed. In future, I will do it in the beginning. As I am new to vb.net, I was not able to understand what was mentioned in the reply with respect to the coding. Please do mention what to include where in step,please, or please do help with the complete code. That will be extremely useful.

    Thanks in advance.

    Asaad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width