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.
Printable View
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.
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
Are you potentially going to want to change the list after deployment without having to rebuild the application?
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.Quote:
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,
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
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