小编Cha*_*lie的帖子

open_basedir 限制生效 文件不在允许的路径内

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/home/futbol/data:.:/tmp:/usr/share/php:/usr/share/pear:/usr/local/bin) in /home/futbol/data/www/futbol.kg/libraries/joomla/filesystem/folder.php on line 451
Run Code Online (Sandbox Code Playgroud)

我在 joomla 中收到此警告,登录后,我真的不知道如何解决此问题,也许需要更改一些服务器设置,但是是哪一个?,谢谢

php apache joomla

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

解析DateTime C#对我的格式不起作用

我想将这个日期解析为DateTime "26 July 2015 - 17:57:37".问题是我尝试了不同的格式,但它仍然无法正常工作.

string[] formats = { "dd MMM yyy - hh:mm:ss"};

if (DateTime.TryParseExact(DateofLecture, formats, CultureInfo.InvariantCulture,
                           DateTimeStyles.None, out TempDateTime))
{
     Lecture.DateAndTime = TempDateTime;
}                  
Run Code Online (Sandbox Code Playgroud)

我在互联网上搜索并应用了所有相关的格式,但它从未奏效.

c# datetime

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

在列表中添加一个数字,使其变为20%

我想在数字列表中添加一个数字,以便在该列表中添加此数字后,它是整个列表的20%.

目标是在itextsharp PDF中创建表时,将第一列的宽度设置为绝对值(20%),为其他列设置相对值.

例如,这是一个列表{10,30,20,20}.我应该添加什么,它也是列表总和的20%,即20(20 + 10 + 30 + 20 + 20 = 100,20/100 - > 20%).

c# itext percentage

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

Nullrefererencepointer在c#中通过Array或List在列表框中添加值时出现异常

我只是想Listbox在Xaml Code中添加Astrology Stars的名字

public MainPage()
    {
    string[] StarsName = {"Aries","Taurus","Aquarius","Pisces"};

        List<string> Stars = new List<string>(StarsName);

        foreach (string abc in StarsName)
        {
            listBox1.Items.Add(abc.ToString());
        }
    }
Run Code Online (Sandbox Code Playgroud)

......

然后我尝试制作StarName列表

                  foreach (string abc in Stars)
                 {
                   listBox1.Items.Add(abc.ToString());
                 }
Run Code Online (Sandbox Code Playgroud)

每次运行代码时,都会出现NullReferenceException以下行

                 listBox1.Items.Add(abc.ToString());
Run Code Online (Sandbox Code Playgroud)

更多我想知道,我怎么能直接将这些数据绑定到XAML中的listview.

c# listbox nullpointerexception

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

取消装箱后无法访问类的成员

我正在学习高级C#.在下面的代码中,我正在尝试进行事件处理

我在取消装箱后访问类发件人的成员时遇到错误//编译器不允许我使用这些名称

//    Console.WriteLine("Sender is {0} and message is {1}",obj.name,obj.messgae);
Run Code Online (Sandbox Code Playgroud)

为什么会这样?这就是我们所说的拳击和拆箱,如果我不会感到困惑.

在我到目前为止所做的所有示例中,都有事件类继承EventArgs.该课程需要什么.虽然在这里我没有使用过这个课程,但我直接使用了Eventargs(只是制作了它).

      namespace ConsoleApplication5
    {
        class eventclass : EventArgs
        {
            string var;
        }
        delegate void GenerateEvent(object source, EventArgs e);
        class Sender
        {
            public void MyMethod()
            {
                Console.WriteLine("My method Called");

            }
            private string name;
            public string Name
            {
                get
                {
                    return name;
                }
                set
                {
                    name = value;
                }
            }

            private string message;
            public string Message
            {
                get
                {
                    return message;
                }
                set
                {
                    message = value;
                }
            }
            public event …
Run Code Online (Sandbox Code Playgroud)

c# events unboxing object

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

多线程问题,也许是使用Foreach的DeadLock

Parallel.ForEach继续运行,我的程序没有结束.我无法追踪第一次迭代后的位置.我的猜测是获得死锁并继续进行上下文切换.

private void ReadInputFile()
{
    var collection = new ConcurrentBag<PropertyRecord>();
    var lines = System.IO.File.ReadLines(InputFileName);
    int i = 0;
    int RecordsCount = lines.Count();
    Parallel.ForEach(lines, line =>
    {
        if (string.IsNullOrWhiteSpace(line))
        {
            return;                    
        }

        var tokens = line.Split(',');
        var postalCode = tokens[0];
        var country = tokens.Length > 1 ? tokens[1] : "england";

        SetLabelNotifyTwoText(
            string.Format(
                "Reading PostCode {0} out of {1}"
                i,
                lines.Length));

        var tempRecord = GetAllAddesses(postalCode, country);
        if (tempRecord != null)
        {
            foreach (PropertyRecord r in tempRecord)
            {
                collection.Add(r);
            }
        }    
    }); …
Run Code Online (Sandbox Code Playgroud)

.net c# task-parallel-library parallel.foreach

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