我正在使用Visual Studio 2010(C#)编写Web应用程序.我想在单击按钮时将PDF(保存在我的电脑中)发送到打印机.
为了创建PDF,我使用了iTextSharp.我试过这个,但它只是打开Adobe Reader:
proc.StartInfo.FileName = @"C:\Archivos de programa\Adobe\Reader10.0\Reader\AcroRd32.exe";
proc.StartInfo.Arguments = String.Format(@"/p /h {0}", pdfFileName);
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
Run Code Online (Sandbox Code Playgroud)
先感谢您!!!
在MVC3中.当我点击它时,我有一个按钮类"open-deleteRowDialog"转到这个javascript:
$(document).on("click", ".open-DeleteRowDialog", function () {
var pwd= '@Url.("GeneratePsw","Admin")';
$(".modal-body #pwd").val(pwd);
$('#1').modal('show');
})
Run Code Online (Sandbox Code Playgroud)
我想要的是调用一个方法(在控制器中),谁必须返回一个字符串,这就是我要保存在"var pwd"中以显示在模型中(视图)
方法(在控制器中)是:
public string GeneratePsw()
{
HomeBridgeEntities ddbb = new HomeBridgeEntities();
SqlConnection Cn = new SqlConnection(((System.Data.EntityClient.EntityConnection)ddbb.Connection).StoreConnection.ConnectionString);
SupPassGenerator sup = new SupPassGenerator(Cn);
//psw conteins a password from CreateRandomPassword
string psw = sup.CreateRandomPassword(9);
return psw;
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
我有这样的查询,返回其我的用户名userid
是access
表users
,我要的是给我回那些userid
谁在没有用户access
:
var query = db.Users
.Join(db.Access, c => c.UserId, o => o.UserId,
(c, o) => new { c.UserId, c.Name });
Run Code Online (Sandbox Code Playgroud)
在SQL中它会是这样的:
SELECT Users.Name
FROM Access INNER JOIN
Users ON Access.UserId <> Users.UserId
Run Code Online (Sandbox Code Playgroud)
什么是lambda expression
sql脚本的等价物?