|
Accessing Server Variables From Within Web Services本文关键字 理论探讨 广告 Accessing Server Variables From Within Web Services
Manohar Kamath Level: Beginner One of the most often asked question in newsgroups is "How do I get the IP address of the client browser within a web service?" The answer is very simple. The Context class within the system.web.services namespace represents the context of the web service. In other words, it has reference to various objects from within a running web service -- things like Response, Request and Session objects, and also such information as if the debugging is enabled on the service. In this article, we will take a look at a very basic example that describes two things Retrieve the IP address of the client browser <%@ Webservice Language="C#" class="httpvars"
%> public class httpvars :
WebService // This method returns the all the server variables as
HTML serverVars = Context.Request.ServerVariables; // Retrieve all the Keys from server variables
collection // Loop through the keys array and obtain
the 如果您希望与本文章的作者或其所在机构,进一步交流,请联系:畅享网 姜小姐 jill.jiang@amteam.org | 021-51096826-112 | 在线联系 |
前沿论丛2009年第三期——知识管理..国内中小企业普遍存在管理基础薄弱、规范化程度低、信息化基础差等方面的问题,而知识管理的实施难度甚至要高于ERP的实施,因为简单的从上而下压迫式的推行只能做到知识…… |
|
|