I have hosted a webservice in my server. I have list of ip(4) from where i will get the request. I don't want others to access my webservice. How do i acheive this? Is it possible through code? Please give a solution.
1. Can be set in IIS if this is running on its on server, virtual server. This would be the best solution as stops hackers accessing near the top of the chain.
2. C# code
if(Context.Request.UserHostAddress == '192.168.0.0' || Context.Request.UserHostAddress == '192.168.0.1')
// Code for webservice
// Your not allowed
Context.Response.Status = 403; // Forbidden
Please give a solution.
Many people in many cultures will find it offensive if you tell them what to do, espcially when your the one asking for help. Thier attitude will be, if you want them to help you, you get it in any form they see fit. Hope this helps you for the future.
Last edited by SirKilljoy; Apr 6, 2009 at 07:55.
Reason: Staus = 403 not 404, btw I didn't see wwb_99 post when I replied. So don't wish to sound like I disagree with him in anyway