本文整理汇总了C#中HttpRequest.getParameter方法的典型用法代码示例。如果您正苦于以下问题:C# HttpRequest.getParameter方法的具体用法?C# HttpRequest.getParameter怎么用?C# HttpRequest.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.getParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: saveAttributes
/*
* Save to storage the attributes, which <names> are provided, and which values are
* to be retrieved from the http request <request>
*/
protected void saveAttributes(String[] names, HttpRequest request)
{
byte pin=0;
GpioPwm.PinType pinType=GpioPwm.PinType.Input;
uint rise=0;
uint fall=0;
uint period=0;
bool state = false;
foreach (String name in names)
{
if (name == Names.pin)
{
string ret=HttpServerUtility.UrlEncode(request.getParameter(name));
Debug.Print(ret);
pin=byte.Parse(ret);
}
if (name == Names.pinType)
{
pinType = (GpioPwm.PinType)byte.Parse(HttpServerUtility.UrlEncode(request.getParameter(name)));
}
if (name == Names.pwmRise)
{
rise=uint.Parse(HttpServerUtility.UrlEncode(request.getParameter(name)));
}
if (name == Names.pwmFall)
{
fall=uint.Parse(HttpServerUtility.UrlEncode(request.getParameter(name)));
}
if (name == Names.pwmPeriod)
{
period=uint.Parse(HttpServerUtility.UrlEncode(request.getParameter(name)));
}
if (name == Names.outputState)
{
string result = HttpServerUtility.UrlEncode(request.getParameter(name));
if (result == bool.TrueString)
{
state = true;
}
}
}
GP.SetPinType(pin, pinType);
GP.SetPwmParameter(pin,GpioPwm.PwmParameter.Rise,rise);
GP.SetPwmParameter(pin,GpioPwm.PwmParameter.Fall,fall);
GP.SetPwmParameter(pin,GpioPwm.PwmParameter.Period,period);
GP.SetPin(pin, state);
}