问题列表 - 第19454页

302和307重定向有什么区别?

a 302 FOUND307 TEMPORARY REDIRECTHTTP响应有什么区别?

W3规范似乎表明它们都用于临时重定向,除非响应特别允许,否则它们都不能被缓存.

redirect http

196
推荐指数
6
解决办法
13万
查看次数

C#中有多个初始化的语法快捷方式吗?

有没有办法做到这一点:

valueType x = 1, y = 1, z = 1;
Run Code Online (Sandbox Code Playgroud)

少了人物?
例如,当我有大量的状态初始化为相同的起始值时.
谢谢!

c# syntax language-features

5
推荐指数
2
解决办法
7716
查看次数

获得当前用户的角色

有没有办法在我的控制器中获得用户所属的显式角色?这假定使用ASP.NET成员资格和角色提供程序."IsInRole"不起作用 - 我需要实际获取它们所在角色的名称.

asp.net-mvc

31
推荐指数
4
解决办法
7万
查看次数

帮助让"Windows输入模拟器"C#界面正常工作

这看起来非常适合我正在尝试做的事情.我需要停止使用SendInput()并让其他人为我做这件事!

http://inputsimulator.codeplex.com/

问题是没有文档可以让代码像在主页上那样简单地工作.有人可以帮助我解决我需要在程序中使用的"其他代码",这样我就可以InputSimulator.SimulateKeyPress(VirtualKeyCode.SPACE);像他在示例中那样输入吗?

我开始时:

[DllImport("InputSimulator.dll", CharSet = CharSet.Auto, SetLastError = true)]

我认为是正确的.我还需要什么?

谢谢!

c# dll interface input keyboard-hook

1
推荐指数
1
解决办法
8641
查看次数

Visual Basic 中长度未知的数组

我有一段用 Visual Basic 编写的代码:

Dim n As Double, i As Integer
n = 4
Dim Ramp_length(1 To 4) As Double
For i = 1 To n
    Ramp_length(i) = Cells(13 + i, 5)
    'Cells(65 + i, 7) = Ramp_length(i)'
Next i
Run Code Online (Sandbox Code Playgroud)

有没有一种方法可以在不声明具有“固定”长度的数组的情况下重现结果?我最终希望代码读取一列长度未知的数据并将其存储在长度相等或更小的数组中,以便可以对其进行更改。这只是一段代码……如果有人可以帮助我,那就太好了!:D

谢谢

vb.net arrays

6
推荐指数
1
解决办法
3万
查看次数

查询对象模式(设计模式)

我需要在Java中为我的可自定义搜索界面(我正在编写的webapp)实现一个查询对象模式.

有谁知道我在哪里可以获得查询对象模式(Martin Fowler的QoP)的示例/教程?

提前致谢

加成如何查询模式添加到现有的DAO模式?

java design-patterns

12
推荐指数
1
解决办法
2万
查看次数

线程有什么实际的替代品吗?

在阅读SQLite时,我在FAQ中偶然发现了这句话:"线程是邪恶的.避免使用它们."

我非常尊重SQLite,所以我不能忽视这一点.根据"避免他们"政策,我想到了我还能做什么,而是使用它来平行我的任务.例如,我目前正在处理的应用程序需要一个始终响应的用户界面,并且需要不时地轮询多个网站(每个网站至少需要30秒).

所以我打开了从常见问题解答链接的PDF,基本上似乎本文提出了几种与线程一起应用的技术,例如障碍或事务性内存 - 而不是任何完全替换线程的技术.

Given that these techniques do not fully dispense with threads (unless I misunderstood what the paper is saying), I can see two options: either the SQLite FAQ does not literally mean what it says, or there exist practical approaches that actually avoid the use of threads altogether. Are there any?


Just a quick note on tasklets/cooperative scheduling as an alternative - this looks great in small examples, but I wonder whether a …

language-agnostic multithreading thread-safety

12
推荐指数
2
解决办法
3805
查看次数

How to choose the "Key" for inter-processes communication in Linux?

Good Day...

I am doing a homework which states that I have 5 processes; a server and the rest are clients. Each process is supposed to be sparked from a different executable. I am going to implement a two-way message passing solution, but the question is not about message passing per se. Is there an elegant way to communicate the key between those different executables. i.e. when I call the following function:

int msgget(key_t key, int msgflg);
Run Code Online (Sandbox Code Playgroud)

How are …

linux ipc message-passing

4
推荐指数
1
解决办法
3358
查看次数

Reference HTML Elements by name (with square brackets in them) via javascript

Hey everyone, I am trying to hide/show different html elements (div, etc...) based on whether a checkbox is checked or if a specific value is chosen from a dropdown box. I was wondering if someone can help me out. The html element is defined along the lines of this (below), and i'm not sure how to reference it by name with brackets in it. The page i'm using has jquery enabled, and i'd like to use it if possible. Thanks! …

html javascript forms jquery

4
推荐指数
1
解决办法
4520
查看次数

如何保护我的脚本免于"免费"?

我想将我的Web应用程序分为两部分.一部分是免费的,就像人们使用的演示一样.另一部分不是; 已付款但需要授权和使用许可的扩展程序.

我的想法是出售扩展而不会受到损害.一旦扩展销售,买方就无法将其上传到其他网站并使其"免费"供其他人使用.因此,扩展将检查来自另一个域的数据库以授权使用其脚本.

我怎样才能做到这一点?

php web-applications

0
推荐指数
1
解决办法
163
查看次数