windows笔记

1.启动apache服务的时候发现80端口被占用,pid是4,这是 worldwide web publishing service这个服务占用了,在windows服务里面把它关掉就行了

2. 8.3文件格式
通常指较旧的Windows操作系统或DOS的文件命名限制 
8指文件名最大长度为8 
3指扩展名最大长度为3 
若不符合以上限制则会以"~"作延长名称如"Program Files"会变成"Progra~1" 
若同一文件夹有相似的名称,末端的数值则会自动递增

Windows 按以下方式从长文件名生成短文件名:
  • Windows 删除文件名中的任何无效字符和空格。无效字符包括:
    . " / \ [ ] : ; = ,
  • 由于短文件名只能包含一个英文句点 (.),因此,Windows 将删除文件名中的其他英文句点,即使文件名中最后一个英文句点后面是有效的非空格字符,也是如此。例如,Windows 从长文件名
    This is a really long filename.123.456.789.txt
    生成短文件名
    Thisis~1.txt
    否则,Windows 将忽略最后一个英文句点,而使用倒数第二个英文句点。例如,Windows 从长文件名
    This is a really long filename.123.456.789.
    生成短文件名
    Thisis~1.789
  • 生成短文件名如果需要的话,Windows 将文件名截断为 6 个字符,并在后边附加一个波形符 (~) 和一个数字。例如,创建的每个以"~1"结尾的唯一文件名。复制文件名以"~2"、"~3"等结尾。
  • 生成短文件名Windows 将文件扩展名截断为 3 个字符或更短。
  • 生成短文件名Windows 将文件名及扩展名中的所有字符转为大写。
注意,如果文件夹或文件名包含空格但少于 8 个字符,则 Windows 仍会创建短文件名。当通过网络访问此类文件或文件夹时,这种情况可能会引起问题。要解决这个问题,请用有效字符代替空格,例如下划线 (_)。如果执行此操作,则 Windows 不会创建不同的短文件名

例如,"Afile~1.doc"是从"A file.doc"生成的,因为长文件名中包含一个空格。
无法从"A_file.doc"中生成短文件名,因为该文件名中包含的字符少于 8 个并且不包含空格。

短文件名"Alongf~1.txt"是从长文件名"A long filename.txt"生成的,因为长文件名中包含的字符超过 8 个。


3. vs2013下如果想要要出错时定位库函数源代码的位置,需要先加载.pdb文件:在Debug->Options and Settings->Debugging->Symbols下选中Microsoft Symbol Server,在第一次调试时就会从这个服务器把.pdb文件下载下来,你可以把这些文件存到另一个地方,下一次调试时就会优先从本地查找.pdb文件。

有关.pdb文件,官网的阐述如下:

A program database (.pdb) file, also called a symbol file, maps the identifiers that you create in source files for classes, methods, and other code to the identifiers that are used in the compiled executables of your project. The .pdb file also maps the statements in the source code to the execution instructions in the executables. The debugger uses this information to determine two key pieces of information: the source file and line number that are displayed in the Visual Studio IDE and the location in the executable to stop at when you set a breakpoint. A symbol file also contains the original location of the source files, and optionally, the location of a source server where the source files can be retrieved from.

When you debug a project in the Visual Studio IDE, the debugger knows exactly where to find the .pdb and source files for your code. If you want to debug code outside your project source code, such as the Windows or third-party code your project calls, you have to specify the location of the .pdb (and optionally, the source files of the external code) and those files need to exactly match the build of the executables.

详情可以查看:http://msdn.microsoft.com/en-us/library/vstudio/ms241613.aspx#BKMK_Contents



4. 头部注解(Header Annotations):定义在头文件SpecStrings.h中,用于描述一个类型如何用作函数的参数和返回值,用于确保正确调用windows API,若不符合注解描述将会产生level 6000的警告。在win8中使用的是SAL(Standard Annotation Language)。有Buffer Annotation和Advanced Annotation两种。
Buffer Annotation描述函数如何使用它的指针,可以用于检测缓冲区溢出,每个参数可以使用0个或1个。
Advance Annotation提供有关参数或返回值的附加信息,每个参数或返回值也至多只能使用1个。
比如在WinNT.h头文件中,我们可以看到如下定义: 
typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR;
__nullterminated 表示它注解的buffer至多能存取到第一个空字符出现的位置
更多头部注解的资料可以查看msdn: 点击打开链接

5. windows宏__countof用于计算一个静态分配的数组的元素个数,注意得是静态分配的数组,而不是指针。定义于stdlib.h中。

6. sc delete 服务名:删除某项服务
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值