本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.Get方法的典型用法代码示例。如果您正苦于以下问题:C# NameValueCollection.Get方法的具体用法?C# NameValueCollection.Get怎么用?C# NameValueCollection.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Specialized.NameValueCollection
的用法示例。
在下文中一共展示了NameValueCollection.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginProcessRequest
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData)
{
m_request = context.Request;
m_response = context.Response;
m_queryStringCollection = m_request.QueryString;
string location = m_queryStringCollection.Get("location");
string quickDate = m_queryStringCollection.Get("time_scope");
int categoryId = 1;
string flags = "PT";
string sort = "distance-asc";
string backfill = "further";
string upcomingEventQueryUri =
Uri.EscapeUriString(
String.Format("http://api.eventful.com/rest/events/search?app_key={0}&location={1}&date={2}&keywords=music&page_size=20",
m_yahooApiKey,
location,
quickDate,
categoryId,
flags,
sort,
backfill)
);
//XElement upcomingEventsXmlResult = XElement.Load(upcomingEventQueryUri);
m_argList.AddParam("location", String.Empty, location);
m_argList.AddParam("format", String.Empty, m_queryStringCollection.Get("format"));
m_argList.AddParam("current-dateTime", String.Empty, DateTime.UtcNow);
xslt.Transform(upcomingEventQueryUri, m_argList, m_response.Output);
m_asyncResult = new NuxleusAsyncResult(cb, extraData);
m_asyncResult.CompleteCall();
return m_asyncResult;
}
开发者ID:nuxleus,项目名称:Nuxleus,代码行数:34,代码来源:NuxleusHttpUpcomingDotOrgEventListingServiceOperationHandler.cs
示例2: Initialize
public override void Initialize(string name, NameValueCollection config)
{
throw new NotImplementedException();
if (config == null)
throw new ArgumentNullException("config");
if (String.IsNullOrEmpty(name))
name = PROVIDER_NAME;
if (String.IsNullOrEmpty(config["description"]))
{
config.Remove("description");
config.Add("description", "db4o ASP.NET Buffered Event provider");
}
base.Initialize(name, config);
connectionString = ConnectionStringStore.GetConnectionString(config["connectionStringName"]);
if (connectionString == null)
throw new ProviderException("Connection string cannot be blank.");
customInfo = new StringBuilder();
providerName = name;
buffer = config.Get("buffer");
bufferMode = config.Get("bufferMode");
customInfo.AppendLine(string.Format("Provider name: {0}", providerName));
customInfo.AppendLine(string.Format("Buffering: {0}", buffer));
customInfo.AppendLine(string.Format("Buffering modality: {0}", bufferMode));
}
示例3: InitFromRequest
protected new void InitFromRequest(NameValueCollection authResult)
{
base.InitFromRequest(authResult);
Code = authResult.Get(OpenIdConnectParameterNames.Code);
State = authResult.Get(OpenIdConnectParameterNames.State);
}
示例4: GetParametersFromPath
public static MoreLikeThisQuery GetParametersFromPath(string path, NameValueCollection query)
{
var results = new MoreLikeThisQuery
{
IndexName = query.Get("index"),
Fields = query.GetValues("fields"),
Boost = query.Get("boost").ToNullableBool(),
MaximumNumberOfTokensParsed = query.Get("maxNumTokens").ToNullableInt(),
MaximumQueryTerms = query.Get("maxQueryTerms").ToNullableInt(),
MaximumWordLength = query.Get("maxWordLen").ToNullableInt(),
MinimumDocumentFrequency = query.Get("minDocFreq").ToNullableInt(),
MinimumTermFrequency = query.Get("minTermFreq").ToNullableInt(),
MinimumWordLength = query.Get("minWordLen").ToNullableInt(),
StopWordsDocumentId = query.Get("stopWords"),
};
var keyValues = query.Get("docid").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var keyValue in keyValues)
{
var split = keyValue.IndexOf('=');
if (split >= 0)
{
results.MapGroupFields.Add(keyValue.Substring(0, split), keyValue.Substring(split + 1));
}
else
{
results.DocumentId = keyValue;
}
}
return results;
}
示例5: frmMain
public frmMain(NameValueCollection args)
{
InitializeComponent();
cboDevices.DataSource = _service.Devices(DeviceType.Imputed);
cboDevices.ValueMember = "Id";
cboDevices.DisplayMember = "Name";
var i = args.Get("a");
var u = args.Get("b");
long.TryParse(i, out _imputed);
long.TryParse(u, out _user);
if (_imputed == 0 || _user == 0)
{
MessageBox.Show(this, @"La herramienta para enrolamiento de imputados únicamente puede ser usado desde la entrevista de encuadre.", @"Enrolamiento de imputados", MessageBoxButtons.OK, MessageBoxIcon.Stop);
End();
}
_service.GetImputedFromDb(_imputed);
lblName.Text = _service.ImputedInfo.Name;
foreach (var fingerPrint in _service.ImputedInfo.FingerPrints)
{
var chk = ((CheckBox)Controls["chk" + Encoding.ASCII.GetString(new[] { (byte)(65 + fingerPrint.Finger) })]);
CheckBoxState(chk, true);
}
}
示例6: NonEmptyDataContractCollectionBaseCollectionTypeValidator
public NonEmptyDataContractCollectionBaseCollectionTypeValidator(NameValueCollection attributes)
: base(null, null)
{
if (attributes == null)
return;
if(!String.IsNullOrEmpty(attributes.Get("propertyName")))
propertyName = attributes.Get("propertyName");
}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:9,代码来源:NonEmptyDataContractCollectionBaseCollectionTypeValidator.cs
示例7: BeforeHTTPRequest
public override void BeforeHTTPRequest(string qs, NameValueCollection parameters, IDictionary files, StreamWriter writer) {
base.BeforeHTTPRequest(qs, parameters, files, writer);
// Text to Speech
String tts = parameters.Get("tts");
if (tts != null) {
AddOnManager.GetInstance().BeforeHandleVoice(tts, parameters.Get("sync") != null);
}
}
示例8: TimePeriod
public TimePeriod(NameValueCollection vals)
{
var startTimeString = vals.Get("StartTime") ?? "";
if (!string.IsNullOrEmpty(startTimeString))
StartTime = Util.ParseDateTime(startTimeString);
var endTimeString = vals.Get("EndTime") ?? "";
if (!string.IsNullOrEmpty(endTimeString))
EndTime = Util.ParseDateTime(endTimeString);
}
示例9: Get
public void Get ()
{
NameValueCollection col = new NameValueCollection (5);
col.Add ("foo1", "bar1");
Assert.AreEqual (null, col.Get (null), "#1");
Assert.AreEqual (null, col.Get (""), "#2");
Assert.AreEqual (null, col.Get ("NotExistent"), "#3");
Assert.AreEqual ("bar1", col.Get ("foo1"), "#4");
Assert.AreEqual ("bar1", col.Get (0), "#5");
}
示例10: ValidateAsync
public async Task<ValidationResult> ValidateAsync(NameValueCollection parameters, ClaimsPrincipal subject)
{
_validatedRequest.Raw = parameters;
_validatedRequest.Subject = subject;
if (!subject.Identity.IsAuthenticated)
{
return Invalid();
}
var idTokenHint = parameters.Get(Constants.EndSessionRequest.IdTokenHint);
if (idTokenHint.IsPresent())
{
// validate id_token - no need to validate token life time
var tokenValidationResult = await _tokenValidator.ValidateIdentityTokenAsync(idTokenHint, null, false);
if (tokenValidationResult.IsError)
{
return Invalid();
}
_validatedRequest.Client = tokenValidationResult.Client;
// validate sub claim against currently logged on user
var subClaim = tokenValidationResult.Claims.FirstOrDefault(c => c.Type == Constants.ClaimTypes.Subject);
if (subClaim != null)
{
if (subject.GetSubjectId() != subClaim.Value)
{
return Invalid();
}
}
var redirectUri = parameters.Get(Constants.EndSessionRequest.PostLogoutRedirectUri);
if (redirectUri.IsPresent())
{
if (await _uriValidator.IsPostLogoutRedirecUriValidAsync(redirectUri, _validatedRequest.Client) == true)
{
_validatedRequest.PostLogOutUri = redirectUri;
}
else
{
return Invalid();
}
var state = parameters.Get(Constants.EndSessionRequest.State);
if (state.IsPresent())
{
_validatedRequest.State = state;
}
}
}
return Valid();
}
示例11: InitFromRequest
protected new void InitFromRequest(NameValueCollection authResult)
{
base.InitFromRequest(authResult);
ExpiresIn = authResult.Get(OpenIdConnectParameterNames.ExpiresIn);
TokenType = authResult.Get(OpenIdConnectParameterNames.TokenType);
IdToken = authResult.Get(OpenIdConnectParameterNames.IdToken);
AccessToken = authResult.Get(OpenIdConnectParameterNames.AccessToken);
RefreshToken = authResult.Get(Constants.OpenIdConnectParameterNames.RefreshToken);
}
示例12: CrossServiceContractModelTIandPMTValidator
/// <summary>
/// Initializes a new instance of the <see cref="CrossDataContractModelTIandPMTValidator"/> class.
/// </summary>
/// <param name="attributes">The attributes.</param>
public CrossServiceContractModelTIandPMTValidator(NameValueCollection attributes)
: base(attributes)
{
if (attributes == null)
{
return;
}
currentMessageTemplate = String.IsNullOrEmpty(attributes.Get(crossModelReferenceValidatorMessageKeyName)) ?
Resources.CrossServiceContractModelTIandPMTValidator :
attributes.Get(crossModelReferenceValidatorMessageKeyName);
}
示例13: ImplementationTechnologyAndSerializerCrossModelValidator
/// <summary>
/// Initializes a new instance of the <see cref="CrossDataContractModelTIandPMTValidator"/> class.
/// </summary>
/// <param name="attributes">The attributes.</param>
public ImplementationTechnologyAndSerializerCrossModelValidator(NameValueCollection attributes)
: base(attributes)
{
if(attributes == null)
{
return;
}
currentMessageTemplate = String.IsNullOrEmpty(attributes.Get(crossModelReferenceValidatorMessageKeyName)) ?
Resources.ServiceAndServiceImplementationTechnologyCrossModelValidator :
attributes.Get(crossModelReferenceValidatorMessageKeyName);
}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:16,代码来源:ImplementationTechnologyAndSerializerCrossModelValidator.cs
示例14: Parse
private void Parse(NameValueCollection queryString)
{
Keyword = queryString.Get("q");
//TODO move this code to Parse or Converter method
// tags=name1:value1,value2,value3;name2:value1,value2,value3
SortBy = queryString.Get("sort_by");
Terms = (queryString.GetValues("terms") ?? new string[0])
.SelectMany(s => s.Split(';'))
.Select(s => s.Split(':'))
.Where(a => a.Length == 2)
.SelectMany(a => a[1].Split(',').Select(v => new Term { Name = a[0], Value = v }))
.ToArray();
}
示例15: Page_Load
protected void Page_Load(object sender, EventArgs e)
{/* The Params property holds entries obtained from a form with
method="get" or method="post". QueryString only holds method="get"
entries.
*/
c = Request.Params;
if (!IsPostBack)
{
nrecs = int.Parse(c.Get("nrecs"));
Session["nrecs"] = nrecs;
databasename = c.Get("databasename");
Session["databasename"] = databasename;
username = c.Get("username");
Session["username"] = username;
password = c.Get("password");
Session["password"] = password;
tablename = c.Get("tablename");
Session["tablename"] = tablename;
GetConn();
string statement = "select * from " + tablename;
SqlCommand cmd = new SqlCommand(statement, conn);
SqlDataReader Read = cmd.ExecuteReader();
for (int i = 0; i < Read.FieldCount; i++)
{
fieldnames.Add(Read.GetName(i));
type.Add(Read.GetDataTypeName(i));
}
Session["fieldnames"] = fieldnames;
Session["types"] = type;
nfields = Read.FieldCount;
Session["nfields"] = nfields;
}
else
{
GetConn();
ExecuteInsertStatements();
Response.Write("<h1>Insert an additional batch below if requested, or click on the link provided below</h1>");
Response.Write("<p><a href=mainmenup2.html>Click here to go back to the main menu</a></p>");
}
}