⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getprofiledir.pm

📁 此程序是本人编写的在MFC环境下调用Matlab函数进行编程的实例
💻 PM
字号:
package getprofiledir;# $Revision: 1.2 $use Exporter ();@ISA = qw(Exporter);@EXPORT = qw(get_user_profile_dir);use Win32::Registry;use strict;# This function is responsible for obtaining the directory name in which# mexopts.bat and mbuildopts.bat should be stored.sub get_user_profile_dir{# outputs:    my ($userProfile);    # UserProfile environment variable is set by NT only.    $userProfile = $ENV{'UserProfile'};    if ($userProfile eq "")    {        my ($RegKey, $RegValue, $hkey, $value, %values);        # ProfileReconciliation is set on Win95/98 if User Profiles are         # enabled.        if ($main::HKEY_CURRENT_USER->Open("Software\\Microsoft\\Windows\\" .                                           "CurrentVersion\\ProfileReconciliation",                                           $hkey))        {            $hkey->GetValues(\%values);            foreach $value (keys(%values))            {                $RegKey = $values{$value}->[0];                $RegValue = $values{$value}->[2];                if ($RegKey eq "ProfileDirectory") {                    $userProfile = $RegValue;                }            }            $hkey->Close();        }        if ($userProfile eq "")        {            $userProfile = $ENV{'windir'};        }    }    $userProfile .= "\\Application Data\\MathWorks\\MATLAB\\R12";    $userProfile;} # get_user_profile_dir

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -