我正在尝试使用stringbuilder来创建一个字符串体,用于文本(而不是HTML)电子邮件.但是有些行(我包含动态数据,不添加新行,但在某些行中,换行符按预期工作).
在使用stringbuilder类时是否存在基本的缺失或是否存在应该发生的更基本的过程?
在下面的代码中:
sbUser.AppendLine("Please find below confirmation of your registration details. If any of these details are incorrect, please email someone@somewhere.com");
sbUser.AppendLine();
sbUser.AppendLine("Selected event : " + ContentPage.FetchByID(int.Parse(ddlEvent.SelectedValue)).PageTitle);
sbUser.AppendLine("Date of event : " + thisEvent.EventStartDate.ToString("dd MMM yyyy"));
sbUser.AppendLine("==============================================================");
sbUser.AppendLine();
Run Code Online (Sandbox Code Playgroud)
(ContentPage和thisEvent是使用Subsonic(v2)构建的自定义类.PageTitle是字符串的输出类型)
将此作为输出:
Please find below confirmation of your registration details. If any of these details are incorrect, please email someone@somewhere.com
Selected event : My Event Date of event : 16 Sept 2012 ==============================================================
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,代码中第3行之后的所有内容都会使所有内容都转到一行.
但是,我使用的代码更进一步:
sbRR.AppendLine("First name : " + txtFirstname.Text.Trim()); …Run Code Online (Sandbox Code Playgroud) 当我尝试上传文件并将其存储到 s3 位置时,出现错误
Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)
Run Code Online (Sandbox Code Playgroud)
以上是版本问题还是bug?
var express = require('express'),
aws = require('aws-sdk'),
bodyParser = require('body-parser'),
multer = require('multer'),
multerS3 = require('multer-s3');
aws.config.update({
secretAccessKey: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
accessKeyId: 'xxxxxxxxxxxxxxxx',
region: 'us-east-1'
});
var app = express(),
s3 = new aws.S3();
app.use(bodyParser.json());
var upload = multer({
storage: multerS3({
s3: s3,
bucket: 'xxxxx',
key: function (req, file, cb) {
console.log(file);
cb(null, file.originalname); //use Date.now() for unique file keys
}
})
});
//open in browser to see upload form
app.get('/', function …Run Code Online (Sandbox Code Playgroud) 我正在使用 SQL Server 2008 来存储 .NET4 应用程序的会话。会话将存储在 [DatabaseA] 中。没有任何其他自定义配置,因此 ASPState 数据库正是开箱即用的(使用 aspnet_regsql)
我的主应用程序在 [DatabaseB](同一服务器)上运行。在这个数据库中,我有 2 个表,记录了一些数据以及 sessionID。
当通过 SQL 代理运行 [DeleteExpiredSessions] 存储过程(在 DatabaseA 上)时,会话会从 ASPState 中正确删除,但我想扩展它以根据 [DatabaseB] 中的 SessionID 删除行
我尝试编辑 [DeleteExpiredSessions] 存储过程以包含以下 SQL
OPEN ExpiredSessionCursor
FETCH NEXT FROM ExpiredSessionCursor INTO @SessionID
WHILE @@FETCH_STATUS = 0
BEGIN
-- BEGIN MY ADDITIONS
DECLARE @myRecordCount int
SELECT @myRecordCount= COUNT(*) FROM [DatabaseB].dbo.Table1 WHERE [DatabaseB].dbo.Table1.SessionId = @SessionID -- AND [DatabaseB].dbo.Table1.DateEntered < @now
SELECT @myRecordCount
DELETE FROM [DatabaseB].dbo.Table1 WHERE [DatabaseB].dbo.Table1.SessionId = @SessionID AND [DatabaseB].dbo.Table1.DateEntered < …Run Code Online (Sandbox Code Playgroud) 我正在使用itextsharp创建一个pdf文件.我想在pdf文档中为每个页面添加页眉和页脚.谁能告诉我怎么能这样做?
我正在使用itext 5.2.0在此,我无法找到使用HeadeFooter类的选项,该类在早期版本中可用.
提前致谢..
.net ×2
c# ×2
asp.net ×1
itextsharp ×1
multer ×1
multer-s3 ×1
newline ×1
session ×1
sql-server ×1
storage ×1