小编Ozz*_*zzy的帖子

C#Panel作为MDI容器

在C#中,我想创建一个具有MDI容器属性的面板,即.isMdiContainer = true.

我试过这样的事

form.MDIParent = this.panel1;
Run Code Online (Sandbox Code Playgroud)

但那不行.有什么建议?

c# forms mdi panel

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

PHP异常处理程序杀死脚本

基本上我有一个自定义异常处理程序。当我处理异常时,我只希望它回显消息并继续脚本。但是在我的方法处理异常后,脚本不会继续。

这是 php 的行为还是我的异常处理程序做错了什么?

php exception-handling

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

CSS选择不遵循元素的元素

我想选择所有不遵循H3或P的P:

<img>

<p> this is selected</p>

<p> this is not</p>

<p> this is not</p>

<span>

<p> this is selected</p>

<h3>

<p> this is not</p>
Run Code Online (Sandbox Code Playgroud)

我试过了

p + :not(h3, p) and :not(h3, p) + p
Run Code Online (Sandbox Code Playgroud)

但他们不起作用

解决办法是什么?请帮忙

css css-selectors

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

C# ListView 平铺宽度 100%?

我有一个 ListView 设置为 Tileview。ListView 宽度为 300,图块宽度也是如此。

当图块数量不会溢出导致滚动条时,这可以正常工作。

然而,当它溢出时,当垂直滚动条出现时,也会出现水平滚动条,因为垂直滚动条降低了磁贴的列表视图宽度。有没有办法让瓷砖自动调整大小来填充列表视图?

请参阅示例图像:

目前发生的事情: 替代文字

我想要发生的事情: 替代文字

我尝试将宽度设置为 100%,但这不起作用。有任何想法吗?

c# listview tiles winforms fluid-layout

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

C#处理退出事件帮助

Process cExe = new Process();
cExe .StartInfo.FileName = "cexe.exe";
cExe .EnableRaisingEvents = true;
cExe .Exited += this.cExited;
Run Code Online (Sandbox Code Playgroud)

这是退出的方法

private void cExited(object o, EventArgs e)
{
    MessageBox.Show(/* SHOW FILE NAME HERE */);
}
Run Code Online (Sandbox Code Playgroud)

如何从退出的方法中获取有关该过程的信息?哪个变量(o,e)给我这个数据以及它们的含义是什么类型?

c# events process

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

C#PHP样式数组键

我有一个字符串数组:

String[] array1 = new String[10];
Run Code Online (Sandbox Code Playgroud)

无论如何我可以使用nto数字键吗?

array["keyhere"] instead of array1[1]
Run Code Online (Sandbox Code Playgroud)

谁知道怎么样?

c# arrays string key

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

jQuery时间鼠标在元素上(悬停)

我有一个悬停事件附加到几个链接,当你翻过它时会出现一个框.

有没有办法,只有当鼠标在链接上超过500毫秒时才能触发悬停事件?因此,目前只要鼠标越过链接就会出现该框,但我希望它只在鼠标已超过500毫秒或更长时间时出现.

jquery element mouseover hover

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

PHP函数param类型的最佳实践

我目前正在研究一个框架并且已经遇到了麻烦...当有人在框架中调用函数时,我应该如何处理不正确的参数类型?

例:

// Title is expected to be string, comment_num is expected to be int
function example1($title, $comment_num) {


 // Doesnt throw error, just converts type 
 $title = (string) $title;
 $comment_num = (int) $comment_num;

}
Run Code Online (Sandbox Code Playgroud)

要么

// Title is expected to be string, comment_num is expected to be int

function example2($title, $comment_num) {


 if (!is_string($title)) {

  trigger_error('String expected for first parameter', E_USER_WARNING);
  return;
 }

 if (!is_string($title)) {

  trigger_error('Int expected for second parameter', E_USER_WARNING);
  return
 }
}
Run Code Online (Sandbox Code Playgroud)

或者两者兼而有之?抛出错误并转换类型?

这样做的最佳方式是什么?我打算发布它,所以它不仅仅是我使用它,因此我想为其他人想出最好的方法.谢谢.

编辑!!!

所以我决定给出答案,但我也想发布我制作的代码,这可以让我快速检查类型.它很粗糙,但效果很好. …

php frameworks

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

PHP静态类返回引用

我有一个静态方法的类.static方法返回私有静态stdClass对象.

myclass::get() // returns stdClass object
myclass::get()->name // name is hardcoded into the class
Run Code Online (Sandbox Code Playgroud)

我如何更改名称的值,如:

myclass::get()->name = 'bob';
Run Code Online (Sandbox Code Playgroud)

并设置好吗?

我尝试返回对象,如:

return &self::$static_object;
Run Code Online (Sandbox Code Playgroud)

但这会引发语法错误.

我能做什么?

EDIT发布了代码以便澄清

final class config {

    private static $configs = array();

    public static function get($config_name) {

        if (isset($configs[$config_name])) {

            return self::$configs[$config_name];
        }

        $file = __get_file_exists(M_CONFIGS . $config_name, 'conf.');

        if ($file) {

            $config = self::__scope_include($file);

            if (!is_array($config) && !$config instanceof stdClass) {
                /*
                 * 
                 * 
                 * FIX
                 * 
                 * 
                 * 
                 */
                die('ERROR config.php');
            }

            return self::$configs[$config_name] = self::__to_object($config); …
Run Code Online (Sandbox Code Playgroud)

php static reference object

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

Google Chrome 60.0.3112.90 VueJS response.data错误

我正在使用VueJS和$http包对我的网站进行API调用.但是,似乎在Google Chrome 60.0.3112.90上,dataResponse对象的属性不再解析收到的JSON,而是传回一个字符串.

这是Google Chrome中的错误吗?该网站昨天工作正常,没有任何变化,今天没有ajax通话.我只能假设它的新版Chrome,因为最新的FireFox工作得很好.

有人经历过这个吗?

ajax json google-chrome vue.js

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