易截截图软件、单文件、免安装、纯绿色、仅160KB

php中使用com组件出现"拒绝访问"的处理


代码如下,
// 建立一个指向新COM组件的索引
$word = new COM("word.application") or die("Can't start Word!");
// 显示目前正在使用的Word的版本号
echo "Loading Word, v. {$word->Version}
";
exit;
?>
有时候你会得到一个错误,
PHP Fatal error: Uncaught exception 'com_exception' with message 'Failed
to create COM object `word.application': 拒绝访问. '
解决方法:
点击开始菜单,运行dcomcnfg
双击“组件服务”,双击“计算机”,双击“我的电脑”,选择“DCOM设置”
在右边找到需要的COM组件,此例中为“Microsoft Word 文档”
右击,打开“属性”菜单,选择“安全”标签
将“启动和激活权限”设置成“自定义”,然后点击编辑
点击“添加”>>“高级”>>“立即查找”,找到“internet 来宾用户”(默认为IUSER_电脑名),点击“确定”
将“internet 来宾用户”的权限设置为本地启动允许,本地激活允许
确定,完成
再次运行上述程序,显示结果为
"Loading Word, v. 11.0"
本文地址
DONE.Good Luck.^^
 补充:
php.ini中设置
com.allow_dcom = true
参考资料:
http://bugs.php.net/bug.php?id=32133
http://figured-it-out.com/figured-out.php?sid=24


相关文档:

PHP+Ajax实现Tab效果

用Ajax实现Tab效果的
先创建
ajax.php,在其中输入如下代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 2_1</title>
<me ......

PHP 中判断、循环的几种写法

下面介绍几种PHP中判断、循环的几种写法。
最普通的判断:
<?php
if( $args != NULL )
{
call_func($args);
}
?>
对于单行的执行语句,可以写成:
<?php
if( $args != NULL ) call_func($args);
?>
也可以使用引号的方式。
<?php
if( $args != NULL ):
call_func($args); ......

php表格(test)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type = "text/css">
        &nbs ......

php的simpletest框架对uchome项目进行接口测试脚本

<?php
require_once ('unit_tester.php');
require_once ('reporter.php');
require_once ('../config.php');
require_once ('../source\modules\user\user_api.func.php');
require_once ('../source/base_model.class.php');
Class registertest extends UnitTestCase{
public function testAssertEqual(){
$b ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号