我正在研究IIS6,ASP.NET,VS2008.该网站使用自定义错误处理程序来捕获404错误并提供备用页面.当提供以下形式的网址时:
一切都很完美.但形式的网址:
如果blog.aspx不存在,则失败并显示以下消息:
'/ Crimson'应用程序中的服务器错误.描述:HTTP 404 ......
当我尝试调试时,我的404处理程序中没有任何断点被命中.所以似乎有些事情正在赶上请求.哪里?以及如何让它将请求传递给我的处理程序?
编辑 感谢那些回答的人,但这些想法都没有奏效.我决定以另一种方式解决这个问题.
我正在尝试使用静态curlpp库在VS2008中构建一个C++控制台应用程序.代码 - 例如curlpp示例00 - 如下:
#include "stdafx.h"
#include <curlpp/curlpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
using namespace curlpp::options;
int main(int, char **)
{
try
{
// Our request to be sent.
curlpp::Easy myRequest;
// Set the URL.
myRequest.setOpt<Url>("http://example.com");
// Send request and get a result.
// By default the result goes to standard output.
myRequest.perform();
}
catch(curlpp::RuntimeError & e)
{
std::cout << e.what() << std::endl;
}
catch(curlpp::LogicError & e)
{
std::cout << e.what() << std::endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我已经下载了源代码,并且我的include路径指向了源包含文件,但是当我尝试编译时,我在类型的内联文件中遇到了大量错误:
不允许定义dllimport函数
肯定有很多人使用curlpp和vs2008,我错过了一些明显的东西.
我正在编写一个应用程序来发现PC上存在哪些功能.用户将转到网页,下载应用程序并执行它(带有所有适当的警告,这不是间谍软件).应用程序将使用标准MS api来确定连接速度,安装内存,防火墙健康等等.编写应用程序不是问题,我可以使用脚本主机,C#,C++等.问题是,如果我选择C#有没有保证某种风格的Windows会安装.net?目标PC是XP SP2或更高版本和Vista.
谢谢您的帮助.
我有一个c ++控制台应用程序,我想使用clickonce发布.
当我运行mageui.exe工具并导入可执行文件和从属文件来制作应用程序清单时,它不会让我将app.exe设置为入口点.我可以设置入口点,但是当我单击该行并转到保存时,它会清除对话框并抱怨我没有有效的入口点.
如果我仍然保存,则生成的清单上的entryPoint为空.这使得clickonce失败,因为没有有效的入口点.
我试过手动创建一个入口点,如下所示:
<entryPoint>
<assemblyIdentity
type='win32'
name='My App'
version='0.9.1.0'
processorArchitecture='msil'
language='en-US'/>
<commandLine
file="app.exe"
parameters="run"/>
</entryPoint>
Run Code Online (Sandbox Code Playgroud)
这也行不通.
我有一个现有的网站,我需要迁移到 IIS 7。该网站(我不想重写)使用 404 错误来提供数据库中的页面。IOW,像http://crimson/pages/myPage这样的 url会导致 404,然后转到 site404.aspx,后者从数据库生成 html。
在 IIS6 中,我设置了一个映射到 aspnet_isapi.dll 的通配符处理程序,并将 404 映射到指向我的 site404.aspx 并且一切正常。
我在带有 IIS 7 的新开发服务器上做了同样的事情,但无法让它工作。
我正在使用 Classic.net AppPool 通配符处理程序看起来像这样
<add name="WildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
Run Code Online (Sandbox Code Playgroud)
CustomErrors 看起来像这样:
<customErrors mode="Off" defaultRedirect="url">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="/site404.aspx" />
</customErrors>
Run Code Online (Sandbox Code Playgroud)
在站点的错误页面选项卡上,404 映射到 aspx 页面,类型设置为执行 URL
尽管如此,我收到以下错误:
HTTP 错误 404.0 - 未找到 您要查找的资源已被删除、更名或暂时不可用。详细错误信息Module IIS Web Core 通知 MapRequestHandler 处理程序静态文件 错误代码 0x80070002 请求的 URL http://srvr:80/crimson/articles/index 物理路径 C:\inetpub\wwwroot\Crimson\articles\index 匿名登录方法 登录用户匿名
感谢您的任何见解。
我有一个用C++编写的程序,可以进行一些计算机诊断.在程序退出之前,我需要它来启动Internet Explorer并导航到特定的URL.我如何从C++中做到这一点?谢谢.
我正在编写一个我希望在Windows或Linux下运行的应用程序.由于它是一个文本应用程序,渲染和用户交互的明显选择是在WebBrowser
控件中使用html .这一切在Windows中使用Mono都非常有用,但我绝对不知道如何在Linux中使用Mono让它工作.我正在运行Linux Mint 17,安装了MonoDevelop和Firefox.以下代码片段编译并运行,但是当应用程序启动时,wbMain
不会显示.尝试使用时渲染html字符串时应用程序死亡wbMain
.
private System.Windows.Forms.Panel pnlMain;
private Mono.WebBrowser.IWebBrowser wbMain;
private System.Windows.Forms.Button btnGo;
this.pnlMain = new System.Windows.Forms.Panel();
this.wbMain = Mono.WebBrowser.Manager.GetNewInstance();
this.wbMain.Activate();
this.btnGo = new System.Windows.Forms.Button();
this.pnlMain.SuspendLayout();
this.SuspendLayout();
//
// pnlMain
//
this.pnlMain.Controls.Add((System.Windows.Forms.Control)this.wbMain.Window);
this.pnlMain.Controls.Add(this.btnGo);
this.pnlMain.Location = new System.Drawing.Point(12, 1);
this.pnlMain.Name = "pnlMain";
this.pnlMain.Size = new System.Drawing.Size(260, 248);
this.pnlMain.TabIndex = 0;
//
// wbMain
//
this.wbMain.Resize(260, 216);
Run Code Online (Sandbox Code Playgroud) 我有以下代码
void reportResults() { wstring env(_wgetenv(L"ProgramFiles")); env += L"\Internet Explorer\iexplore.exe"; wstringstream url; url << "\"\"" << env.c_str() << "\" http://yahoo.com\""; wchar_t arg[BUFSIZE]; url.get(arg, BUFSIZE); wcout << arg << endl; _wsystem(arg); }
其中arg是:""C:\ Program Files\Internet Explorer\iexplore.exe" http://yahoo.com "
该程序按预期运行,启动IE并导航到Yahoo,但调用函数(reportResults)永远不会退出.如何让程序退出让浏览器保持活动状态?谢谢.
我正在使用VS 2008编写一个简单的vanilla c ++控制台应用程序.当我创建项目时,IDE为我提供了.net版本的选择."无"没有选项.当我查看项目属性页面时,Targeted Framework具有我选择的任何值,并且显示为灰色.
当我尝试在没有clr的Windows机器上运行应用程序时,它会给我一个设置错误并退出.
我的代码中没有任何与.net有关的内容.我怎样才能逃脱.net和clr的魔掌呢?