使用Installshield制作asp,asp.net应用的安装程序

 

在使用asp,asp.net编写Web应用时,最大的烦恼莫过于程序的分发的部署,由于面向的最终用户,所以程序的安装的过程必须要简单,方便和快捷。
下面提供了Installshield的脚本,改脚本功能包括:
1,检测IIS是否安装
2,检测IE版本
3,自动建立SQL数据库
4,自动建立IIS虚拟目录
5,能读取注册表和INI文件
6,注册.dll组件
  应用程序开发环境:Windows2000+VS 2003+SQL2000
  制作安装程序环境:Installshield7.0(其实6.22以上都可以,只是中文语言包太难找,所以就用7.0了,另7.0界面也好看多了,XP风格)
复制内容到剪贴板
代码:

//
// File Name: Setup.rul
//
// Description: InstallShield script
//
// Comments: This script was generated based on the selections you made in
// the Project Wizard. Refer to the help topic entitled "Modify
// the script that the Project Wizard generates" for information
// on possible next steps.
//



// Include header files

#include "ifx.h"

// string defines
number xx1,xx2;
installation declarations ///

// ----- DLL function prototypes -----


// your DLL function prototypes


// ---- script function prototypes -----


// your script function prototypes
prototype CreateDataBase(STRING,STRING,STRING);//附加数据库
prototype CheckIIS(); //检测是否安装了iis
prototype Checkie(); //检测ie版本
prototype Checkmdac(); //检测mdac版本
prototype regcom(); //注册jamil组件
// prototype deliis(STRING);//删除虚拟目录
prototype Writeini(STRING,STRING,STRING);
prototype DelDataBase(STRING,STRING,STRING);
// your global variables



//
//
// FUNCTION: OnFirstUIBefore
//
// EVENT: FirstUIBefore event is sent when installation is run for the first
// time on given machine. In the handler installation usually displays
// UI allowing end user to specify installation parameters. After this
// function returns, FeatureTransferData is called to perform file
// transfer.
//
///
function OnFirstUIBefore()
// number nResult,nSetupType;
// string szTitle, szMsg;
// string szLicenseFile, szQuestion;
// string szName, szCompany;
// string szTargetPath;
// string szDir;
// string szFeatures, szTargetdir;
// number nLevel;
// LIST listStartCopy;
//number nvSize;
//number nUser;

number nResult,nSetupType;
string szTitle, szMsg;
string szLicenseFile, szQuestion;
string szName, szCompany, szSerial;
string szFeatures, szTargetdir;
number nLevel;
LIST listStartCopy,list;
number nvSize;
number nUser;

number nOpt,svEdit1,svEdit2;
STRING szServerIP,szServerPort,szServerIPDefault,szServerPortDefault;
STRING szSQLsvr,szSQLusr,szSQLpwd,svSQLsvr,svSQLusr,svSQLpwd;
STRING svName, svCompany, svSerial;
STRING szFile,szTargetPath,szDir,szfolder;
STRING szField1,szField2;
STRING szDefault,svResult;
string szComponents;
OBJECT piisObj;
STRING szTitle1;
STRING szMsg1,szMsg2;
STRING szMsg11, szMsg12, szOpt1, szOpt2;
BOOL bvOpt1, bvOpt2;
begin
// TO DO: if you want to enable background, window title, and caption bar title
//SetTitle( @PRODUCT_NAME, 24, WHITE );
// SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
// SetColor(BACKGROUND,RGB (0, 128, 128));
//SetFont (FONT_TITLE, STYLE_NORMAL, "宋体");
SHELL_OBJECT_FOLDER = @PRODUCT_NAME;

nSetupType = TYPICAL;
szDir = INSTALLDIR;
szName = "";
szCompany = "";

Dlg_Start:
// beginning of dialogs label

Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome( szTitle, szMsg );
if (nResult = BACK) goto Dlg_Start;

Dlg_SdLicense:
szLicenseFile = SUPPORTDIR ^ "license.txt";
szTitle = "";
szMsg = "";
szQuestion = "";
nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
if (nResult = BACK) goto Dlg_SdWelcome;

Dlg_SdCustomerInformation:
szMsg = "";
szTitle = "";
nResult = SdCustomerInformation( szTitle, szName, szCompany, nUser );
if (nResult = BACK) goto Dlg_SdLicense;

Dlg_SdAskDestPath:
szTitle = "";
szMsg = "";
nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
INSTALLDIR = szDir;
if (nResult = BACK) goto Dlg_SdCustomerInformation;
Dlg_SelMode ://设置数据库服务器 对话框
szTitle = "是否安装.net框架";
szMsg = "是否要安装.net框架,如果已经安装了.net框架则不需要安装。";
szField1="我要安装.net框架。";
szField2="我已经安装了,不需要再安装。";
svEdit1=TRUE;
svEdit2=FALSE;
SetDialogTitle(DLG_ASK_TEXT,szTitle);
//DialogSetInfo ( DLG_INFO_CHECKSELECTION, "", 1);
nOpt = EXCLUSIVE ;
nResult = AskOptions (nOpt,szMsg,szField1,svEdit1,szField2,svEdit2);
if (nResult = BACK) goto Dlg_SdAskDestPath;
if (svEdit1=TRUE)then
if Checkmdac() then//如果已经安装则跳过
if(LaunchAppAndWait (SUPPORTDIR^"mdac_typ.exe","",WAIT)<0) then
MessageBox ("安装微软数据访问组件是发生以外,请重新安装。",SEVERE);
goto Dlg_SelMode;
endif;
endif;
if(LaunchAppAndWait ( SUPPORTDIR ^"dotnetfx.exe " , "" ,WAIT)<0) then
MessageBox ("安装.net框架时发生意外,请重新安装。",SEVERE);
goto Dlg_SelMode;
endif;
endif;

Dlg_SetupType:
szTitle = "";
szMsg = "";
nResult = SetupType ( szTitle , szMsg , "" , nSetupType , 0 );
if (nResult = BACK) then
goto Dlg_SdAskDestPath;
else
nSetupType = nResult;
if (nSetupType != CUSTOM) then
szTargetPath = INSTALLDIR;
nvSize = 0;
FeatureCompareSizeRequired(MEDIA,szTargetPath,nvSize);
if (nvSize != 0) then
MessageBox( szSdStr_NotEnoughSpace, WARNING );
goto Dlg_SetupType;
endif;
endif;
endif;

Dlg_SdFeatureTree:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
szTitle = "";
szMsg = "";
szTargetdir = INSTALLDIR;
szFeatures = "";
nLevel = 2;
if (nSetupType = CUSTOM) then
nResult = SdFeatureTree(szTitle, szMsg, szTargetdir, szFeatures, nLevel);
if (nResult = BACK) goto Dlg_SetupType;
endif;

Dlg_AskText ://设置数据库服务器 对话框
szTitle = "设置IIS信息服务及数据库服务器";
szMsg = "现在开始设置IIS系统";
szQuestion=" 请输入本服务器的主机名或IP地址,安装程序将按照您提供的资料设置IIS信息服务。如果您没有填写,安装程序将自动跳过站点的创建!";
szServerIP="地址:";
szServerPort="端口:";
szServerIPDefault="192.168.0.1";
szServerPortDefault="80";
SetDialogTitle(DLG_ASK_TEXT,szTitle);
nResult=SdShowDlgEdit2 (szTitle, szQuestion,szServerIP,szServerPort,szServerIPDefault,szServerPortDefault);
if (nResult = BACK) goto Dlg_SetupType;

Dlg_AskSQL ://设置数据库服务器 对话框
szTitle = "设置数据库";
szMsg = "现在开始设置数据库系统";
szQuestion=" 请输入数据库服务器的用户名和密码,安装程序将按照您上步提供的IP地址和下面的用户名和密码创建和优化数据库系统。如果您提供的用户名和密码是错误的,安装程序将自动跳过数据的设置!";
//szSQLsvr="主机名:";
szSQLusr="用户名:";
szSQLpwd="密码:";
//svSQLsvr="localhost";
svSQLusr="sa";
svSQLpwd="";
SetDialogTitle(DLG_ASK_TEXT,szTitle);
nResult=SdShowDlgEdit2 (szTitle, szQuestion,szSQLusr,szSQLpwd,svSQLusr,svSQLpwd);
if (nResult = BACK) goto Dlg_AskText;



Dlg_SdStartCopy:
szTitle = "";
szMsg = "";
szTitle1 = "安装失败";
szMsg11 = "由于安装时发生意外导致安装失败";
szMsg12 = "点击完成退出安装。";
szOpt1 = "";
szOpt2 ="";
listStartCopy = ListCreate( STRINGLIST );
ListAddString(listStartCopy,"用户名:"+szName,AFTER);
ListAddString(listStartCopy,"公司名称:"+szCompany,AFTER);
ListAddString(listStartCopy,"目标目录:"+szDir,AFTER);
if (svEdit1=TRUE) then
ListAddString(listStartCopy,"IP地址:"+szServerIPDefault,AFTER);
ListAddString(listStartCopy,"端口号:"+szServerPortDefault,AFTER);
endif;
ListAddString(listStartCopy,"请确认您填写的信息,按下一步开始复制文件",AFTER);

// listStartCopy = ListCreate( STRINGLIST );
//The following is an example of how to add a string(szName) to a list(listStartCopy).
//eg. ListAddString(listStartCopy,szName,AFTER);
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
ListDestroy(listStartCopy);
if (nResult = BACK) goto Dlg_SdFeatureTree;

Enable(STATUSEX);
if CheckIIS() then
if(xx1=2) goto Dlg_AskText; //判断站点是否建立成功
// regcom();//注册组件
CreateDataBase(szServerIPDefault,svSQLusr,svSQLpwd); // 创建和 优化数据库
Writeini(szServerIPDefault,svSQLusr,svSQLpwd);//写ini文件
else
MessageBox ("你的计算机没有安装IIS!请安装后重试!",SEVERE);
endif;
return 0;
end;

///
//
// FUNCTION: OnMaintUIBefore
//
// EVENT: MaintUIBefore event is sent when end user runs installation that
// has already been installed on the machine. Usually this happens
// through Add/Remove Programs applet. In the handler, installation
// usually displays UI allowing end user to modify existing installation
// or uninstall application. After this function returns,
// FeatureTransferData is called to perform file transfer.
//
///
function OnMaintUIBefore()
NUMBER nResult, nType;
STRING szTitle, szMsg, svDir, svResult, szCaption;
STRING svip,svuser,svpass;
begin
// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @PRODUCT_NAME, 24, WHITE );
// SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );
// SetColor(BACKGROUND,RGB (0, 128, 128));
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );

Dlg_Start:
Disable(BACKBUTTON);
nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
Enable(BACKBUTTON);

if (nType = REMOVEALL) then
svResult = SdLoadString(IFX_MAINTUI_MSG);
szCaption = SdLoadString(IFX_ONMAINTUI_CAPTION);
nResult = SprintfBox(MB_OKCANCEL,szCaption,"%s",svResult);
if (nResult = IDCANCEL) goto Dlg_Start;
endif;

nResult = NEXT;

Dlg_SdFeatureTree:
if (nType = MODIFY) then
szTitle = "";
szMsg = "";
nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2);
if (nResult = BACK) goto Dlg_Start;
endif;

switch(nType)
case REMOVEALL: FeatureRemoveAll();
case REPAIR: FeatureReinstall();
endswitch;
GetProfString (SystemFolder^"dbconn.ini", "dbconnection","ip", svip);
GetProfString (SystemFolder^"dbconn.ini", "dbconnection","db_user", svuser);
GetProfString (SystemFolder^"dbconn.ini", "dbconnection","db_pass", svpass);
//svall=svip+","+svuser+","+svpass;
// SdShowMsg(svall,WAIT);
// Delay(5);
DelDataBase(svip,svuser,svpass);
DeleteFile (INSTALLDIR^"database\\kill.out");
Enable(STATUSEX);

end;


//
// 创建和优化数据库
//
function CreateDataBase(svSQLsvr,svSQLusr,svSQLpwd)
STRING szCmdLine1,szWaitTxt,szdatabase,szdatabase1,path,path1,path3;
begin
path=INSTALLDIR^"database\\fenoffice.mdf";
path3=INSTALLDIR^"database\\fenoffice_log.ldf";
szWaitTxt=" 正在创建数据库....";
SdShowMsg (szWaitTxt, TRUE);
Delay(2);
//CopyFile(SUPPORTDIR^"kill.sql",INSTALLDIR^"database\\kill.sql");
CopyFile(SUPPORTDIR^"fenoffice.mdf",INSTALLDIR^"database\\fenoffice.mdf");
CopyFile(SUPPORTDIR^"fenoffice_log.ldf",INSTALLDIR^"database\\fenoffice_log.ldf");
//szCmdLine="hello";
szdatabase = "/U "+svSQLusr+" /P "+svSQLpwd+" /S "+svSQLsvr+" /Q \"exec sp_attach_db N'fenoffice' , N'"+path+"',N'"+path3+"'\"";
//SdShowMsg(szdatabase,WAIT);
//Delay(3);
if (LaunchAppAndWait("osql.exe", szdatabase,WAIT)<0) then;
MessageBox ("数据库创建失败!请确您的系统中已安装 Microsoft SQL Server 2000.\n如仍无法解决,请联系系统供应商!",SEVERE);
endif;
path1=INSTALLDIR^"database";
//szdatabase1=" -S "+svSQLusr+" -U "+svSQLusr+" -P "+svSQLpwd+" -d master -n -i "+path1+"\\kill.sql -o "+path1+"\\kill.out";
//SdShowMsg(szdatabase2,WAIT);
//Delay(3);
if (LaunchAppAndWait("osql.exe", szdatabase1,WAIT)<0) then
MessageBox ("配置数据库失败!请尝试手动配置!",SEVERE);
endif;

SdShowMsg (szWaitTxt, FALSE);
return 0;
end;


//
//
//检测是否安装了iis
//
//
function CheckIIS()
NUMBER nvType, nvSize;
STRING svvalue;
begin
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
if (RegDBKeyExist ("System\\CurrentControlSet\\Services\\IISADMIN" ) = 1) then
return (1);
else
return (0);
endif;
end;


//
//
//检测ie的版本
//
//
function Checkie()
NUMBER nvType, nvSize;
STRING svvalue,szKey,szName;
begin
szKey="SOFTWARE\\Microsoft\\Internet Explorer";
szName="version";
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx(szKey, szName, nvType, svvalue, nvSize );
if(svvalue="6.0.2600.0000")then
return (0);
else
return (1);
endif;
end;


//
//检测mdac的版本
//
//
function Checkmdac()
NUMBER nvType, nvSize;
STRING svvalue,szKey,szName;
begin
szKey="SOFTWARE\\Microsoft\\DataAccess";
szName="version";
RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
RegDBGetKeyValueEx(szKey, szName, nvType, svvalue, nvSize );
if(svvalue="2.71.9030.9") then
return (0);
else
return (1);
endif;
end;


//
//
//Write dbconn.ini file
//
//
function Writeini(svSQLsvr,svSQLusr,svSQLpwd)
string svDate,iniFile,svResult,szInfo,szWaitTxt;
NUMBER nvResult;
begin
//szWaitTxt="正在配置系统文件,请稍侯....";

iniFile =SUPPORTDIR^"dbconn.ini";
//SdShowMsg (szWaitTxt, TRUE);
// Delay(2);
if (GetSystemInfo (DATE, nvResult, svResult) < 0) then

szInfo = "不能得到系统时间";

else
svDate=svResult+" ";
endif;

if (GetSystemInfo (TIME, nvResult, svResult) < 0) then

szInfo = "不能得到系统时间";

else
svDate=svDate+svResult;
endif;

if (WriteProfString(iniFile,"dbconnection","server", svSQLsvr) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;

if (WriteProfString(iniFile,"dbconnection","ip", svSQLsvr) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;

if (WriteProfString(iniFile,"dbconnection","db_user",svSQLusr) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;

if (WriteProfString(iniFile,"dbconnection","db_pass",svSQLpwd) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;

if (WriteProfString(iniFile,"dbconnection","database", "fenoffice") <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;

if (WriteProfString(iniFile,"webwork","webworkstart", svDate) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;
if (WriteProfString(iniFile,"webwork","webworkpath", INSTALLDIR) <0) then
MessageBox("dbconn.ini错误,系统将无法运行!", SEVERE);
endif;
CopyFile(SUPPORTDIR^"dbconn.ini",SystemFolder^"dbconn.ini");
end;


//
//注册组件
//
function regcom()
string szLine,szWaitTxt;
begin
szLine=SystemFolder^"jmail.dll";
szWaitTxt=" 正在注册组件....";
SdShowMsg (szWaitTxt, TRUE);
Delay(2);
CopyFile(SUPPORTDIR^"jmail.dll",SystemFolder^"jmail.dll");
if (LaunchAppAndWait("regsvr32.exe",szLine,WAIT)<0) then
MessageBox ("注册组件失败,请尝试手动注册"+szLine,SEVERE);
// else
// MessageBox ("注册组件成功!"+szLine,INFORMATION);
//SdShowMsg (szLine, TRUE);
// Delay(3);
endif;
end;

//function deliis(VirtualFolder)
//STRING szCmdLine;
//begin
//删除已经存在的虚拟目录
// szCmdLine = SUPPORTDIR ^"adsutil.vbs delete w3svc/1/root/"^VirtualFolder;
// if(LaunchAppAndWait("CScript.exe", szCmdLine, WAIT)<0) then
// MessageBox ("设置iis信息服务失败,请尝试手动配置!",INFORMATION);
// endif;
//end;


//
//删除数据库
//
//
function DelDataBase(server,user,pass)
STRING szWaitTxt,szdatabase1,szdatabase2,szdatabase3,path1;
begin


szWaitTxt=" 正在删除数据库....";

szdatabase2 = "/U "+user+" /P "+pass+" /Q \" exec killspid N'fenoffice'";
LaunchAppAndWait("osql.exe", szdatabase2,WAIT);
//SdShowMsg(szdatabase2,WAIT);
//Delay(3);
szdatabase3 = "/U "+user+" /P "+pass+" /Q \" exec sp_dbremove N'fenoffice'" ;
LaunchAppAndWait("osql.exe", szdatabase3,WAIT);
//SdShowMsg(szdatabase3,WAIT);
//Delay(3);
SdShowMsg (szWaitTxt, FALSE);
return 0;
end;

转载于:https://www.cnblogs.com/itelite/archive/2007/11/29/977077.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/436294.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

用java查询excel表格_如何把java查询出的内容导入到excel表格

展开全部java查询出的内容导入到excel表格/**导出数据为XLS格式* param fos* param bo*/public void writeExcelBo(FileOutputStream fos, java.util.Vector ve){jxl.write.WritableWorkbook wwb;try{wwb Workbook.createWorkbook(fos);jxl.write.WritableSheet ws wwb.createS…

【转】C#开发奇技淫巧三:把dll放在不同的目录让你的程序更整洁

转自&#xff1a;https://www.cnblogs.com/marvin/p/PutDllToSpecificFolder.html?utm_sourcetuicool&utm_mediumreferral 系列文章 C#开发奇技淫巧一&#xff1a;调试windows系统服务C#开发奇技淫巧二&#xff1a;根据dll文件加载C或者Delphi插件C#开发奇技淫巧三&#…

【转】C#开发奇技淫巧二:根据dll文件加载C++或者Delphi插件

这两天忙着把框架改为支持加载C和Delphi的插件&#xff0c;来不及更新blog了。 原来的写的框架只支持c#插件&#xff0c;这个好做&#xff0c;直接用c#的反射功能便可。但是公司不是所有人都搞C#&#xff0c;也不是所有的程序C#都能很好的完成&#xff0c;又或者其他公司…

Linux编程练习 --多线程3--mutex

互斥指互相排斥的锁&#xff0c;是一种信号量&#xff0c;常用来防止两个进程或线程在同一时刻访问相同的共享资源 1.数据类型&#xff1a; 在Linux下, 线程的互斥量数据类型是pthread_mutex_t&#xff0c;我们定义一个互斥数据可以这样&#xff1a; pthread_mutex_t mutex; 2.…

java ppt转html_word,ppt,excel转pdf,pdf转html工具类搭建

我看到很多需求要求word,excel,ppt&#xff0c;pptx转pdf等工具类。还有就是pdf转图片转html这里介绍一个这个工具类。引入pom.xmlcom.asposeaspose-pdf11.0.0com.asposewords15.9.0com.asposeaspose-slides15.9.0工具类代码&#xff1a;package com.lvic.prsp.common.util;imp…

【转】一篇易懂的CAN通讯协议指南1

转自&#xff1a;https://zhuanlan.zhihu.com/p/162708070 本文力求以图文并茂来接好CAN通讯协议的基础知识&#xff0c;希望能给有兴趣的朋友带来一些收获。 为了便于大家理解与接受&#xff0c;请先看一幅图&#xff1a; 图1 电话会议 简单地讲CAN总线就如上图1中两根粗黄线…

长字串与短字串

procedure TForm1.Button1Click(Sender: TObject); vars1: ShortString; //为兼容老版本而存在s2: string; //长字串&#xff0c;相当于动态字符数组s3: string[10]; //短字串&#xff0c;相当于静态字符数组&#xff0c;代替 ShortString beginShowMessage(IntToStr(…

Linux编程练习 --多线程4--条件变量

上一篇练习了互斥锁的用法和原理&#xff0c;这次学习和互斥锁一起应用的cond--条件变量 1.互斥锁的存在问题&#xff1a; 互斥锁一个明显的缺点是它只有两种状态&#xff1a;锁定和非锁定。设想一种简单情景&#xff1a;多个线程访问同一个共享资源时&#xff0c;并不知道何时…

在PHP中实现中文汉字验证码

PHP代码<?php /********************************* * Code by Gently * 24/07/07 *严正声明&#xff1a;验证码为程序随机生成&#xff0c;“某种巧合”的词语组合属于正常现象&#xff0c; *某些别有用心的人不要借题发挥&#xff01; **************…

java哈夫曼编码译码_哈夫曼编码与译码 java

展开全部package qwp;import java.util.ArrayDeque;import java.util.ArrayList;import java.util.Collections;import java.util.HashSet;import java.util.List;import java.util.Queue;import java.util.Scanner;public class HuffmanCoding {public static String writeStr…

【转】预编译头文件

http://www.cnblogs.com/nzbbody/p/3437868.html 1、解决什么问题&#xff1f; C 编译器是单独、分别对每个cpp文件进行预编译&#xff08;也就是对#include&#xff0c;#define 等进行文本替换&#xff09;&#xff0c;生成编译单元。编译单元是一个自包含文件&#xff0c;C编…

Linux编程练习 --多线程5--信号量(semaphore)

这一篇练习信号量的应用 信号量本质上是一个非负的整数计数器&#xff0c;也是UNIX中古老的实现进程互斥和同步的手段&#xff0c;Linux下信号量概念是在线程中&#xff0c;信号则在进程控制中&#xff0c;不过原理差不多&#xff0c;最基本最经典的操作莫过于P、V操作了&#…

【转】CAN协议深度解析-简单易懂协议详解

转自&#xff1a;https://zhuanlan.zhihu.com/p/343607068 CAN接口兼容规范2.0A和2.0B(主动)&#xff0c;位速率高达1兆位/秒。它可以接收和发送11位标识符的标准帧&#xff0c;也可以接收和发送29位标识符的扩展帧。 扩展帧的仲裁域有29位&#xff0c;可以出现2^29中报文&…

深度神经网络下的风格迁移模型(C#)

版权声明&#xff1a;本文为博主原创文章&#xff0c;转载请在显著位置标明本文出处以及作者网名&#xff0c;未经作者允许不得用于商业目的。 这个是C#版本的&#xff0c;这里就只放出代码。VB.Net版本请参看 深度神经网络下的风格迁移模型-CSDN博客 斯坦福大学李飞飞团队的…

使用 Visual Studio 2005 Team System 进行单元测试并生成用于 Unit Test Framework 的源代码...

PS&#xff1a;微软专家写的一往篇VSTS2005测试功能说明&#xff0c;非常详细。适合初学者查看。适用于&#xff1a;Microsoft Visual Studio 2005 Team System Beta 2Team Architect & Team Test EditionsMicrosoft Visual C# 2005摘要&#xff1a; Scott 详细介绍自动化单…

java银行利率_Java-银行计算利息

Bank类public class Bank {int savedMoney;int year;double interest;double interestRate0.29;public double computerInterest(){interestyear*interestRate*savedMoney;return interest;}public void setInterestRate(double rate){interestRaterate;}}ConstructionBank类pu…

【转】C++ win32窗口创建详解

转自&#xff1a;https://my.oschina.net/u/4328928/blog/3315324 本篇所讲解的内容仅限于 Windows 操作系统且限于 win32程序设计 现在我们在Windows系统上用的软件, 早已不是控制台界面, 而是窗体应用程序 窗体与控制台的区别就是: 有了窗口的概念 由于C的语法复杂, 使得…

java 子类继承父类_关于Java 的继承问题,子类会继承父类的哪些东西?-----转载...

和C类似&#xff0c;可以继承基类的公共属性和方法。在Java继承里&#xff0c;父类的属性还有方法在声明时&#xff0c;如果是public关键字即公共属性&#xff0c;则在子类继承时&#xff0c;这些属性和方法都会被子类继承。受保护的也可以继承但是私有的类属性成员和方法则无法…

天气很冷晚饭很香

今天和zhoujia 去吃她家门口的东北菜&#xff0c;席间谈笑风生&#xff0c;突然她说“亲爱的&#xff0c;眼光要看的长远一些”&#xff0c;附带标准的领导手势&#xff0c;让我笑翻。zhoujia是个乐观的人&#xff0c;从来没有见她发愁过&#xff0c;她的房子装修的也差不多了&…

【转】win32窗口的大小,居中,拖动

参考 https://www.cnblogs.com/findumars/p/3948315.html 不让调整大小 窗口风格设置&#xff0c;后面两个是最大最小化按钮 dwStyle^WS_THICKFRAME^WS_MAXIMIZEBOX^WS_MINIMIZEBOX 不让拖动 消息循环里添加 case WM_NCLBUTTONDOWN: { switch (wParam) …