小编per*_*456的帖子

生成PDF时无法获取捷克语字符

在生成PDF时添加"Č"或"Ć"等字符时出现问题.我主要使用段落在我的PDF报告中插入一些静态文本.这是我使用的一些示例代码:

var document = new Document();
document.Open();
Paragraph p1 = new Paragraph("Testing of letters ?,?,Š,Ž,?", new Font(Font.FontFamily.HELVETICA, 10));
document.Add(p1);
Run Code Online (Sandbox Code Playgroud)

生成PDF文件时得到的输出如下所示:"测试字母,Š,Ž,Đ"

出于某种原因,iTextSharp似乎不会识别这些字母,例如"Č"和"Ć".

c# pdf asp.net unicode itextsharp

10
推荐指数
1
解决办法
7177
查看次数

PayPal API Http调用问题

我已经为用户集成了一个选项,通过PayPal在我正在创建的网上商店进行在线购物.当我开始收到此错误时突然出现问题:

You must write ContentLength bytes to the request stream before calling [Begin]GetResponse. 
Run Code Online (Sandbox Code Playgroud)

Http调用的代码如下:

   public string HttpCall(string NvpRequest)
        {
            string url = pEndPointURL;

            string strPost = NvpRequest + "&" + buildCredentialsNVPString();
            strPost = strPost + "&BUTTONSOURCE=" + HttpUtility.UrlEncode(BNCode);

            HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
            objRequest.Timeout = Timeout;
            objRequest.Method = "POST";
            objRequest.ContentLength = strPost.Length;

            try
            {
                using (StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream()))
                {
                    myWriter.Write(strPost.ToString());
                }
            }
            catch (Exception e)
            {

            }

            //Retrieve the Response returned from the NVP API call to PayPal. 
            HttpWebResponse …
Run Code Online (Sandbox Code Playgroud)

c# asp.net paypal httpwebrequest httpwebresponse

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

在c ++中初始化指针数组

我忘了如何在c ++中初始化指针数组,如下所示:

int * array[10]; 
Run Code Online (Sandbox Code Playgroud)

这是一个合适的解决方案吗?这里:

array = new int[10];

 // is this the correct way?? 
Run Code Online (Sandbox Code Playgroud)

c++ arrays

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

每月重置 MySql 列值

我想知道是否有任何方法可以每月重置 MySql 中的值。比如说我有一个点列,四月的值是 500。当新的月份开始时,我希望 MySql(或任何需要的东西)将该值重置回 0,以便每个新的月份值为 0。有哪些可能的方法可以做到这一点?一般来说,我对 MySQL 和 PHP 还很陌生,所以我不太确定在这里该怎么做?有人可以帮我吗?谢谢大家!

此致

php mysql reset

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

Javascript获得月份名称

我有一个jQuery onclick函数,基本上收到一个月的名字,从那个月的名字,我想得到一个月的范围.比如我正在传递一个月名"May",如下所示:

 $('#swiperNext').click(function(e)
   {
       var currentMonth = $('.swiper-slide-active h3').html();
       console.log(currentMonth);
   });
Run Code Online (Sandbox Code Playgroud)

现在我想将当前月份名称传递给JS函数并获取该月份的日期范围.

所以例如May将=> 01-05-2016 - 31-05-2016,依此类推......有人可以帮我解决这个问题吗?

javascript jquery date range

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

从日期开始在PHP中获取月份名称

我在我的php函数中有一个日期,如下所示:

2016-05-17 16:41:51
Run Code Online (Sandbox Code Playgroud)

我有什么方法可以在PHP中获取此日期的月份名称吗?

php date

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

在iTextSharp中操作行和单元格的宽度和高度

我使用以下代码填充我的PdfPTable:

  public PdfPTable GetTable(List<hsp_Narudzbe_IzdavanjeFakture4_Result> proizvodi)
    {
        PdfPTable table = new PdfPTable(5);
        table.WidthPercentage = 100F;
        table.DefaultCell.UseAscender = true;
        table.DefaultCell.UseDescender = true;
        Font f = new Font(Font.FontFamily.HELVETICA, 13);
        f.Color = BaseColor.WHITE;
        PdfPCell cell = new PdfPCell(new Phrase("Stavke narudžbe: ", f));
        cell.BackgroundColor = BaseColor.BLACK;
        cell.HorizontalAlignment = Element.ALIGN_CENTER;
        cell.Colspan = 5;
        table.AddCell(cell);
        for (int i = 0; i < 2; i++)
        {
            table.AddCell("Redni broj");
            table.AddCell("Proizvod");
            table.AddCell("Cijena");
            table.AddCell("Šifra proizvoda");
            table.AddCell("Kolicina");
        }
        table.DefaultCell.BackgroundColor = BaseColor.LIGHT_GRAY;
        table.HeaderRows = 3;
        table.FooterRows = 1;
        int broj = 0;
        table.DeleteLastRow(); …
Run Code Online (Sandbox Code Playgroud)

c# asp.net height itextsharp width

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

使用 ASP.NET 查询字符串重写 URL

我想在 ASP.NET 中用查询字符串重写 URL。URL 如下所示:

http://localhost:51392/productdetails.aspx?id=zdpMPZVXkDtjw92Crx7eew==
Run Code Online (Sandbox Code Playgroud)

我想将 url 改写成这样:

http://localhost:51392/Details/zdpMPZVXkDtjw92Crx7eew==
Run Code Online (Sandbox Code Playgroud)

我尝试使用以下方法重写 url(类似这样):

 <urlMappings>
      <add url="~/Shop"   mappedUrl="~/shop.aspx"/>
</urlMappings>
Run Code Online (Sandbox Code Playgroud)

但我不太确定如何使用查询字符串正确映射 URL?可用于实现此目的的最简单或其他方法是什么?

谢谢!

PS 伙计们,这就是我尝试访问重写 URL 的方式:

<a href='<%# "/productdetails.aspx?id=" + RL_DAL.RijndaelHelper.AES.Encrypt(Eval("ProductID").ToString(),"key_to_enrypt")  %>'><%# Eval("ProductName") %>
Run Code Online (Sandbox Code Playgroud)

c# asp.net .htaccess mod-rewrite url-rewriting

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

虚拟属性readonly - 无法更改其值

我正在尝试动态地将DB中的值分配给继承自EpiServer PageData类的属性.这就是我的意思:

namespace Episerver9.Models.Pages
{
    [ContentType]
    public class StartPage : PageData
    {
        public virtual string Username { get; set; }
        public virtual string Password { get; set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }

        [ReadOnly(false)]
        [Editable(true)]
        public virtual string testfield { get; set; }


    }
}
Run Code Online (Sandbox Code Playgroud)

在控制器中我正在尝试以下方法:

namespace Episerver9.Controllers
{
    public class StartPageController : PageController<StartPage>
    {
        // GET: StartPage

        public ActionResult Index(StartPage currentPage)
        {
            currentPage.testfield = "test";
            return View(currentPage);
        } …
Run Code Online (Sandbox Code Playgroud)

c# properties episerver readonly

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

获取当前月份的月份名称-到PHP年底

我从数据库中获取了当前月份,这基本上是用户的加入日期。可以说使用加入了本月,现在是5月。我获取月份名称的代码如下所示:

$months = array();
array_push($months,date("F",strtotime($me['joinTime'])));
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我将开始月份添加到数组中,在这种情况下是5月...现在我想做的是随着月份的过去,我想将每个新月添加到数组中。因此,例如在六月的几天内,以及六月开始的时候,我也会将该月份也添加到数组中。因此,我的问题是,如何从开始日期获得月份的其余名称(可以)。

我需要六月,七月,八月,九月,十月,十一月,十二月...

如果开始月份是四月,我也将五月添加到数组中...

有人可以帮我这个忙吗?

php arrays date

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

Episerver 检查内容区域是否为空

我需要检查内容区域是否为空,但出现错误“对象引用未设置为实例”,这是我的页面控制器,我也尝试过currentPage.TabContentArea.IsEmpty,仍然是相同的错误。内容区域是空的,这是我第一次尝试运行它,所以我需要在执行 if 语句中的代码之前检查它是否为空。

     public class StandardPageController : PageController<StandardPage>
    {
        // GET: StandardPage
        public   ActionResult Index( StandardPage currentPage)
        {

            // this collection should be used in foreach loops
            var tabItems = new List<TabViewModel>();


//this is where I get error
            if(currentPage.TabContentArea.FilteredItems.Any())

 { 
            var contentAreaItems = currentPage.TabContentArea.FilteredItems.ToList();
            var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();

            foreach (var contentAreaItem in contentAreaItems)
            {
                // get an instance of Tab Block
                // If you didn't set any restrictions, ContentArea can contain anything.
                // We need to check if …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc episerver

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