我想弄清楚 Windows 错误报告的保存位置;我今天早些时候点击了发送,但我忘记了我想“查看详细信息”,以便我可以检查内存小型转储。
但我找不到它们的存储位置(谷歌不知道)。
所以我想编写一个会崩溃的虚拟应用程序,显示 WER 对话框,让我点击“查看详细信息”,这样我就可以进入保存转储的文件夹。
如何在 Windows 上崩溃?
编辑:我问的原因是因为我尝试过溢出堆栈,并且浮点数除以零。Stack Overflow 使应用程序消失,但没有弹出 WER 对话框。浮点除以零导致 +INF,但没有例外,也没有崩溃。
windows winapi windows-xp error-reporting windows-error-reporting
如何将这种易于编写(和读取)的字符串格式化例程转换为"适当的" String.Format等效代码?
Int32 power;
Single voltage;
Int32 kVA;
Double powerFactor;
powerFactor = power / kVA;
label1.Text =
DateTime.Now.ToString() + ": " +
power.ToString() + "W, " +
voltage.ToString() + "V "+
"(pf "+(powerFactor*100.0).ToString()+"%)";
//label1.Text = String.Format("{g}: {0:g}W, {0:g}V (p.f. {0:0%}%)",
// DateTime.Now, power, voltage, powerFactor);
Run Code Online (Sandbox Code Playgroud)
我花了大约10分钟尝试使用String.Format; 记录它的人应该被终止.
关于Delphi中构造函数的一系列问题还有另一个问题.
我有一个具有虚拟构造函数的基类:
TComputer = class(TObject)
public
constructor Create(Teapot: Integer); virtual;
end;
Run Code Online (Sandbox Code Playgroud)
构造函数是虚拟的,适合有人需要调用的时间
var
computerClass: class of TComputer;
computer: TComputer;
begin
computer := computerClass.Create(nTeapot);
Run Code Online (Sandbox Code Playgroud)
构造函数overridden位于后代:
TCellPhone = class(TComputer)
public
constructor Create(Teapot: Integer); override;
end;
TiPhone = class(TCellPhone )
public
constructor Create(Teapot: Integer); override;
end;
Run Code Online (Sandbox Code Playgroud)
哪里TCellPhone和TiPhone后代都有机会进行自己的初始化(为了便于阅读而不包括成员).
但是现在我向一些祖先添加了一个重载的构造函数:
TCellPhone = class(TComputer)
public
constructor Create(Teapot: Integer); override; overload;
constructor Create(Teapot: Integer; Handle: string); overload;
end;
Run Code Online (Sandbox Code Playgroud)
TCellPhone中的备用构造函数调用另一个虚拟构造函数,因此它始终获得正确的重写行为:
constructor TCellPhone.Create(Teapot: Integer; Handle: string);
begin
TCellPhone.Create(Teapot); //call sibling virtual …Run Code Online (Sandbox Code Playgroud) 我想看一下存储过程,视图或用户定义函数的定义.
在SQL Server Management Studio 2005中,我发现这样做的唯一方法是:
我不想编写脚本,我想看一下.
我今天在SSMS中的任务是快速浏览存储过程以找到我感兴趣的人.我已经在Windows XP模式下加载了企业管理器(MMC管理单元在64位中不能以任何方式运行),以及我的工作要容易得多:
我正试图找到查看存储过程的方法 - 我对编写脚本不感兴趣.
我想测试一些代码,以确保它处理NAN,INF并-INF输入正确.
我知道存在返回的功能 NAN,INF和-INF,但是作为Double:
unit IEEE754;
...
function NAN: Double;
function PositiveInfinity: Double;
function NegativeInfinity: Double;
Run Code Online (Sandbox Code Playgroud)
除了在我的情况下,我需要测试a何时Currency是这三个边缘情况值之一.不幸的是,你无法将这些中的任何一个转换为Double:
Test(NAN);
procedure Test(const Value: Currency);
...
Run Code Online (Sandbox Code Playgroud)
将a转换为a 时,存在EInvalidOp 无效的浮点运算异常.Double NANCurrency
是否可以指定NAN一个Currency?
也许,而不是它是可以指定一个NAN到Currency,它是不是没有可能的-我可以忽略这种边缘情况.
我可以忽略这个边缘情况吗?
是否可以"将货币值设置为NAN,INF或-INF?"
{ David Heffernan says it's impossible for a currency to contain INF,-INF or …Run Code Online (Sandbox Code Playgroud) 考虑以下列表Label:
Collection<Label> labels = new Collection<Label>();
Run Code Online (Sandbox Code Playgroud)
现在我想将其转换为以下集合Controls:
public void ScaleControls(ICollection<Control> controls) {}
Run Code Online (Sandbox Code Playgroud)
我会试着打电话:
ScaleControls(labels);
Run Code Online (Sandbox Code Playgroud)
但那不会编译.
ScaleControls((ICollection<Control>)labels);
Run Code Online (Sandbox Code Playgroud)
编译,但在运行时崩溃.
ICollection<Control> controls = (ICollection<Control>)labels;
ScaleControls(c);
Run Code Online (Sandbox Code Playgroud)
编译,但在运行时崩溃.
有没有办法传递对象的通用列表?
另一种方法是放弃通用列表,并使用类型化列表:
public class ControlList : Collection<Control>
{
}
pubic void InvalidateControls(ControlList controls)
{
}
Run Code Online (Sandbox Code Playgroud)
但这意味着所有使用泛型的代码都必须进行改造.
我正在尝试写出对客户的回复:
response.StatusCode = (int)HttpStatusCode.BadRequest;
response.ClearContent();
response.Write(String.Format(
"<!doctype html>"+CRLF+
"<html>" + CRLF +
"<head><title>{0}</title></head>" + CRLF +
"<body><h1>{0}</h1>"+CRLF+
"{1}"+CRLF+
"</body>" + CRLF +
"</html>",
response.Status, "The grob must be in the frobber."));
response.Flush();
response.End();
Run Code Online (Sandbox Code Playgroud)
在localhost上运行时代码工作正常(Visual Studio(2010(Windows 7(专业版(64位)))))开发Cassini Web服务器:
HTTP/1.1 400 Bad Request
Server: ASP.NET Development Server/10.0.0.0
Date: Tue, 17 Jul 2012 15:56:42 GMT
X-AspNet-Version: 4.0.30319
Cache-Control: private
Content-Type: text/html
Connection: Close
<!doctype html>
<html>
<head><title>400 Bad Request</title></head>
<body><h1>400 Bad Request</h1>
The grob must be in the frobber.
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但是当我将网站部署到运行IIS7.5的Windows Server …
我正在使用指定给我的文化将字符串转换为值IFormatProvider.
我想弄清楚他们给了我哪种文化.
我意识到这IFormatProvider并不一定要与a相对应System.Globalization.Culture,但确实如此.
那么我怎么能得到它的名字?
在虚拟字符串树中是否可以在每列中都有一个复选框(或单选按钮)?这是一张有关更多信息的图片:
我试图附加单选按钮/复选框,但只附加在节点的第一列.
c# ×4
delphi ×3
delphi-5 ×2
asp.net ×1
constructor ×1
delphi-xe2 ×1
generics ×1
iis-7.5 ×1
infinity ×1
nan ×1
ssms ×1
winapi ×1
windows ×1
windows-7 ×1
windows-xp ×1