问题列表 - 第11690页

PHP - 包含一个php文件,还发送查询参数

我必须根据某些条件从我的PHP脚本中显示一个页面.我有一个if条件,如果条件满足,我正在做"包含".

if(condition here){
  include "myFile.php?id='$someVar'";
}
Run Code Online (Sandbox Code Playgroud)

现在问题是服务器有一个文件"myFile.php",但我想用一个参数(id)调用这个文件,"id"的值会随着每次调用而改变.

有人可以告诉我如何实现这一目标吗?谢谢.

php parameters include

80
推荐指数
5
解决办法
15万
查看次数

正则表达新手问题

鉴于此文本

"美孚(酒吧)"

我想用正则表达式提取"Bar".

救命!

regex

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

C#:List <T>和Collection <T>之间的区别(CA1002,不公开通用列表)

试图在这里运行一个项目的运行代码分析,并得到一些警告说,像这样:

CA1002:Microsoft.Design:在' SomeClass.SomeProtectedOrPublicProperty '中更改'List < SomeType > '以使用Collection,ReadOnlyCollection或KeyedCollection

我为什么要用Collection<T>而不是List<T>?当我查看msdn文档时,它们看起来几乎相同.在阅读了警告的错误帮助后,我发现了

System.Collections.Generic.List(T)_是一个通用集合,专为性能而非继承而设计,因此不包含任何虚拟成员.

但这究竟意味着什么呢?我应该做什么呢?

我应该继续在List<T>内部使用,然后在属性中返回一个new Collection<T>(someList)而不是?或者我应该开始使用Collection<T>而不是List<T>

c# collections encapsulation

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

如何创建POD并在perl中使用pod2usage?

我想为我自己的自定义命令创建一个POD,并使用pod2usage()函数显示该语法的语法.

谁能给我一个简单的例子呢?

此致,阿南丹

perl pod

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

C#:如何在使用DirectoryInfo时登录共享

如果我想使用UNC路径实例化DirectoryInfo对象

DirectoryInfo myDI = new DirectoryInfo (@"\\server\share");
Run Code Online (Sandbox Code Playgroud)

如何传递访问该共享所需的用户名/密码?

谢谢

c# unc directoryinfo

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

完成某些计算后如何取消选择选择框

只是想知道如何取消选择选择选项框,我使用.remove(),但这实际上删除了选择框中的文本,

还有其他办法吗?

谢谢

jquery

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

为什么ItemsControl项目之间有细线(1像素?)?

当我在ItemsControl中的项目上有背景颜色,并将边距设置为0时,WPF会在项目之间留下细线,好像ItemsControl包装管道占用了一小部分空间.我用Snoop检查了可视化树,所有边距都设置为0,0,0,0.

导致这些线路的原因是什么,我该如何避免它们?

alt text http://i32.tinypic.com/9tzh1d.png

XAML:

<DockPanel>

    <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Background="Yellow" >
        <ItemsControl ItemsSource="{Binding CustomerList}">

            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Background="DarkGreen">
                        <TextBlock Text="{Binding LastName}"/>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>

            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <DockPanel Margin="10"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>

        </ItemsControl>
    </StackPanel>

</DockPanel>
Run Code Online (Sandbox Code Playgroud)

代码隐藏:

using System.Windows;
using System.ComponentModel;
using System.Collections.ObjectModel;
namespace TestItemsControl2938
{
    public partial class Window1 : Window, INotifyPropertyChanged
    {
        private ObservableCollection<Customer> _customerList = new ObservableCollection<Customer>();
        public ObservableCollection<Customer> CustomerList
        {
            get
            {
                return _customerList;
            }

            set
            {
                _customerList = value;
                OnPropertyChanged("CustomerList");
            }
        }

        public …
Run Code Online (Sandbox Code Playgroud)

wpf xaml itemscontrol

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

System.Drawing.Graphics.DrawString - "参数无效"异常

有时微软的异常消息令人愤怒无益.我创建了一个很好的小MVC方法来呈现文本.方法体如下.当它到达"DrawString"方法时,我得到一个异常,说"参数无效".

请注意,我能说的最好的字体构造正确(我只是在10pt使用Arial),rect大小是正面且有效的看起来,画笔是白色的SolidBrush并且格式标志不影响输出;即如果我从调用中排除格式标志,我仍然会收到错误.

DrawString调用就在底部附近.

public ActionResult RenderText(
    string fontFamily,
    float pointSize,
    string foreColor,
    string backColor,
    bool isBold,
    bool isItalic,
    bool isVertical,
    string align,
    string[] allText,
    int textIndex)
{
    // method renders a horizontal or vertical text image, taking all the text strings that will be rendered in each image
    // and sizing the final bitmap according to which text would take the most space, thereby making it possible to render
    // a selection of text images all at the same size. …
Run Code Online (Sandbox Code Playgroud)

.net c# gdi+

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

如何在SQL中使用Wordnet

如何在SQL数据库中使用Wordnet.它是否存在于任何地方都可以有人给我一步一步的程序

sql nlp

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

设置Rails cookie的开始日期和到期日期

如何设置Rails cookie在特定日期开始和/或到期?

cookies ruby-on-rails

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