我尝试使以下简单的HTML页面工作:
<html>
<head>
<style type="text/css">
@media print
{
@page port { size: portrait; }
.portrait { page: port; }
@page land { size: landscape; }
.landscape { page: land; }
.break { page-break-before: always; }
}
</style>
</head>
<body>
<div class="landscape">
<p>This is a landscape page.</p>
</div>
<div class="portrait break">
<p>This is a portrait page.</p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我想将第一个div的内容打印到第一页,横向打印,第二个打印带纵向打印.但是,所有浏览器(Chrome,Opera,Safari,IE10)都会打印两个纵向页面.我错过了什么或者没有一个浏览器支持这种功能吗?在后一种情况下,是否有任何替代方案可以实现这一结果?
我将我的 ASP.NET Core 项目从 RC1 更新到 1.0 RTM(使用 preview2 工具),一切顺利。我可以在 Visual Studio 中毫无问题地进行调试。接下来,我想在 Windows Server 2008 R2 和 IIS 7.5 上上传该站点。我安装了必要的 Windows 托管工具并在 IIS 中创建了 Web 应用程序。问题是,在我尝试打开页面后,它返回了 404 错误。正如我在任务管理器中看到的,我的应用程序正在运行,但在侦听模式下停止。
在日志文件中,我只看到这些条目:
Hosting environment: Production
Content root path: C:\inetpub\wwwroot\MySite
Now listening on: http://localhost:20706
Application started. Press Ctrl+C to shut down.
Run Code Online (Sandbox Code Playgroud)
IIS 集成似乎存在一些问题。我的web.config文件看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="..\..\approot\MySite\MySite.exe" arguments="" forwardWindowsAuthToken="true" stdoutLogEnabled="true" />
<httpErrors errorMode="Detailed" />
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我从 GitHub 尝试了一些变通方法,这影响了 …
当我尝试调用createBitmap时,我得到了一个java.lang.NullPointerException.这是我的代码:
board = Bitmap.createBitmap(handler.signs.length * cellSize,
handler.signs[0].length * cellSize, Bitmap.Config.ARGB_8888);
Run Code Online (Sandbox Code Playgroud)
其中宽度和高度也大于零.这是堆栈跟踪:
java.lang.NullPointerException
at android.graphics.Bitmap.createBitmap(Bitmap.java:478)
at org.me.five_stones_project.game.GameView.drawBoard(GameView.java:334)
at org.me.five_stones_project.game.GameView.increaseBoard(GameView.java:293)
at org.me.five_stones_project.game.GameHandler.checkStatus(GameHandler.java:304)
at org.me.five_stones_project.game.GameHandler.makeMyStep(GameHandler.java:211)
at org.me.five_stones_project.game.GameView.onTouchEvent(GameView.java:238)
at android.view.View.dispatchTouchEvent(View.java:3891)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1719)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1150)
at android.app.Activity.dispatchTouchEvent(Activity.java:2102)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1703)
at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2200)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1884)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:861)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:619)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我看了一下Bitmap的源代码,发现了这个:
476 public static Bitmap createBitmap(int width, int height, Config config) {
477 Bitmap bm = nativeCreate(null, 0, …Run Code Online (Sandbox Code Playgroud) 我在Linux系统上安装了ASP.NET Web应用程序,它运行良好,可以浏览所有内容。现在我想知道,是否有任何可能性或解决方法可以在Kestrel服务器上使用Windows身份验证方案?正如我在Google上搜索后看到的那样,目前不支持此功能。
感谢您的回答。
编辑:
但是Windows身份验证在Kestrel中不起作用,我能够通过在我的webb应用程序中实现NTLM身份验证的质询-响应协议来获取用户名。
基于https://loune.net/2009/09/ntlm-authentication-in-php-now-with-ntlmv2-hash-checking/