小编HAB*_*JAN的帖子

Android 5.1.1上的Html文件输入不显示图库

这就是我试过的:

<input id="capture" name="capture" type="file" accept="image/*" capture="camera">
<input id="capture" name="capture" type="file" accept="image/*" capture>
<input id="capture" name="capture" type="file" accept="image/*;capture=camera">
<input id="capture" name="capture" type="file" accept="image/*;capture=camera" capture>
Run Code Online (Sandbox Code Playgroud)

这是用户代理字符串:

Mozilla/5.0+(Linux;+Android+5.1.1;+SM-J320FN+Build/LMY47V)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/53.0.2785.124+Mobile+Safari/537.36

我面临的问题是,由于某种原因,这个Android设备直接进入相机(打开相机),没有显示任何选项从库中选择文件或使用相机拍照.

有什么建议如何克服这个?

html android

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

代码从一种语言移植到另一种语言 - 许可

我将一些代码从C移植到C#,我还在移植的代码中添加了一些新功能.原始代码受MPL许可.

这是原始源代码许可条款:

/*
 * file name
 * Version .....
 *
 * Copyright (c) 2004-2012 by XXX YYY
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, …
Run Code Online (Sandbox Code Playgroud)

licensing

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

SQL Server 2008 FileStream与普通文件

我正在创建像youtube这样的应用来存储视频,我需要一些建议.

我应该使用SQL Server FileStream来存储视频文件,还是应该将它们存储在硬盘上的某个位置并将路径记录为SQL Server中的varchar(MAX)?

推荐哪个,为什么?

除了这两个之外,你还推荐别的吗?请随时告诉我,但请告诉我为什么.

非常感谢.

c# asp.net filestream sql-server-2008

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

Ghostscript.NET pdf图像无法在windows azure上工作

我正在尝试使用Ghostscript.NET将pdf第一页转换为图像,它在本地IIS上正常工作但在Azure Web应用程序上失败并出现以下错误:

[GhostscriptException:无法为符号'gsapi_revision'创建导出函数的委托]
Ghostscript.NET.GhostscriptLibrary.Initialize()+ 865
Ghostscript.NET.GhostscriptLibrary..ctor(GhostscriptVersionInfo version,Boolean fromMemory)+178
Ghostscript.NET .Interpreter.GhostscriptInterpreter..ctor(GhostscriptVersionInfo version,Boolean fromMemory)+48
Ghostscript.NET.Viewer.GhostscriptViewer.Open(String path,GhostscriptVersionInfo versionInfo,Boolean dllFromMemory)+75
Ghostscript.NET.Viewer.GhostscriptViewer.Open(Stream stream, GhostscriptVersionInfo versionInfo,Boolean dllFromMemory)+59
Ghostscript.NET.Rasterizer.GhostscriptRasterizer.Open(Stream stream,GhostscriptVersionInfo versionInfo,Boolean dllFromMemory)+40
VirtualWindow.Dropzone.Pages.Home.btnUpload_Click(Object sender,EventArgs e)+270
System.Web.UI.WebControls.Button.OnClick (EventArgs e)+116
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)+108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)+12
System. Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,String eventArgument)+15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)+31 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+3582

我的代码如下

protected void btnUpload_Click(object sender, EventArgs e)
{
    if (fileUpload.HasFile)
    {
        string ghostDllPath = HttpContext.Current.Server.MapPath("~/bin/External");
        GhostscriptRasterizer rasterizer = null;
        GhostscriptVersionInfo vesion = null;
        if (Environment.Is64BitProcess)
            vesion = new Ghostscript.NET.GhostscriptVersionInfo(new Version(0, 0, 0), ghostDllPath + …
Run Code Online (Sandbox Code Playgroud)

c# pdf asp.net azure ghostscript.net

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

是否有更简洁的方法在字符串之间插入空格而不是像""?

当我写出一个结合了几个字符串的字符串(即使用stringbuilder或concat)时,我需要在每个字符串之间插入一个空格.我经常这样做:

StringBuilder sb = new StringBuilder();
sb.Append("a" + " " + "b");
Run Code Online (Sandbox Code Playgroud)

有没有更简洁的方法来做上述事情?

谢谢

c# string

4
推荐指数
2
解决办法
9734
查看次数

更改PDF - 文本重新定位

有没有办法将现有pdf页面内的文本移动/移动到其他位置

就像在区域x = 100处有一些文本,y = 100,w = 100,h = 100并且我想将其移动到x = 50,y = 200,w = 100,h = 100.

我做了很多研究,似乎iTextSharp做不到.PDFSharp声称它可以完成,但我找不到任何例子.

一种方法是制作我想要移动的文本的特定区域的位图,在该区域上绘制白色矩形并在新位置插入位图.我不想使用这个解决方案,因为我使用超过1K页面的大型pdf文件,其中每个页面都必须被更改.

我发现的是,我需要找到一种方法来改变文本定位操作符(文本矩阵和文本状态参数),这并不是那么简单.

有人有什么想法吗?

c# pdf pdfsharp itextsharp

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

Ghostscript.NET 图片文字质量问题

我正在尝试使用 ghostscript 将 pdf 文档转换为图像。所需的 dpi 设置为 72 像素,这应该足够高,以便文本显示清晰,但大部分文本难以辨认。

我可以提高 dpi,但这会导致我不想拥有的非常大的图像文件。

我知道ghostscript 有一些参数可以添加抗锯齿等(例如-dDOINTERPOLATE)。如何将它们添加到以下代码中,或者有更好的方法来做到这一点?

        int desired_x_dpi = 72;
        int desired_y_dpi = 72;

        GhostscriptRasterizer _rasterizer = new GhostscriptRasterizer();

        _rasterizer.Open(inputPdfPath, localDllInfo, false);

        for (int pageNumber = 1; pageNumber <= _rasterizer.PageCount; pageNumber++)
        {
            string pageFilePath = Path.Combine(outputPath, "Page-" + pageNumber.ToString() + ".png");

            Image img = _rasterizer.GetPage(desired_x_dpi, desired_y_dpi, pageNumber);
            img.Save(pageFilePath, ImageFormat.Png);
        }
Run Code Online (Sandbox Code Playgroud)

.net c# ghostscript ghostscript.net

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

Ghostscript.NET.dll将pdf打印到指定的打印机

如何使用ghostscript api打印pdf.我试过谷歌,但仍然没有得到适当的解决方案.请帮我完成这项任务.

c# vb.net ghostscript winforms ghostscript.net

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

使用条件运算符时的评估顺序

是否有以下行为?

public class TestClass
{
    public int IntValue { get; set; }
}

TestClass instance = null;

// this line throws exception: Object reference not set to an instance of an object 
string test1 = "abc" + instance != null ? instance.IntValue.ToString() : "0";

// this works
string test2 = instance != null ? instance.IntValue.ToString() : "0";

// this works
string test3 = "abc" + (instance != null ? instance.IntValue.ToString() : "0");
Run Code Online (Sandbox Code Playgroud)

更新:

为什么这不会抛出异常?

TestClass instance = null;
string …
Run Code Online (Sandbox Code Playgroud)

c#

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