当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: samba是个开源的文件服务器软件,可以在多个平台上运行.如果
 

 

 ·自动建站.实现虚拟二级目录    »显示摘要«
    摘要:以前写了一个自动生成网站的建站系统.可是最近要写一个不要自动生成,而是要做到:http://www.cnsnc.cn/用户名所以我想一个用户建立一个目录.可是我想如果上w个用户.那不是我要建立上w个目录.所以我采用iis的404错误和对错误信息的分析写了一个自动转向的代码.先把iis的所有404错误.指到:url:/website.asp?webname=$v然后在网站的根目录下面建立一个:web......
    摘要: 我目前负责北京金日开发部的工作,由于发展的需要,急需一批热爱编程,热爱奉献的开发人员。 软件开发人员、硬件开发人员基本要求: 1、 精通vb,vc等程序语言 2、 有两年以上开发经验 3、 熟悉自动化相关知识 4、 精通plc程序设计(ab,西门子等) 5、 有c#开发经验者 6、 学历不限 7、 工资3000~5000元(具体待遇面议) 【公司简介】 公司网址:ht......


samba unix风格的配置文件配置信息读取C代码.

    samba是个开源的文件服务器软件,可以在多个平台上运行.如果你使用过,那么一定设置过它的配置文件.

    如果你想写一个类似读这样的配置文件的代码,那么下面的从samba提取出来的代码讲对你很有用.它采用 【程序编程相关:MFC程序带参数运行

【推荐阅读:由2个和尚打水想到的---如何学习VB编

    回调的机制,获取配置信息. 【扩展信息:如何量化用户体验

   

smb.conf 如下

# this is the main samba configuration file. you should read the

# smb.conf(5) manual page in order to understand the options listed

# here. samba has a huge number of configurable options (perhaps too

# many!) most of which are not shown in this example

#

# any line which starts with a ; (semi-colon) or a # (hash)

# is a comment and is ignored. in this example we will use a #

# for commentry and a ; for parts of the config file that you

# may wish to enable

#

# note: whenever you modify this file you should run the command "testparm"

# to check that you have not made any basic syntactic errors.

#

#======================= global settings =====================================

[global]

# workgroup = nt-domain-name or workgroup-name

 workgroup = gdcattsoft

# server string is the equivalent of the nt description field

 server string = samba server

# this option is important for security. it allows you to restrict

# connections to machines which are on your local network. the

# following example restricts access to two c class networks and

# the "loopback" interface. for more examples of the syntax see

# the smb.conf man page

;   hosts allow = 192.168.1. 192.168.2. 127.

# if you want to automatically load your printer list rather

# than setting them up individually then you´ll need this

 printcap name = /etc/printcap

 load printers = yes

# it should not be necessary to spell out the print system type unless

# yours is non-standard. currently supported print systems include:

# bsd, sysv, plp, lprng, aix, hpux, qnx, cups

 printing = cups

# uncomment this if you want a guest account, you must add this to /etc/passwd

# otherwise the user "nobody" is used

;  guest account = pcguest

# this tells samba to use a separate log file for each machine

# that connects

 log file = /var/log/samba/%m.log

# put a capping on the size of the log files (in kb).

 max log size = 0

# security mode. most people will want user level security. see

# security_level.txt for details.

# use password server option only with security = server

# the argument list may include:

#   password server = my_pdc_name [my_bdc_name] [my_next_bdc_name]

# or to auto-locate the domain controller/s

#   password server = *

;   password server = <nt-server-name>

# password level allows matching of _n_ characters of the password for

# all combinations of upper and lower case.

;  password level = 8

;  username level = 8

# you may wish to use password encryption. please read

# encryption.txt, win95.txt and winnt.txt in the samba documentation.

# do not enable this option unless you have read those documents

 encrypt passwords = yes

 smb passwd file = /etc/samba/smbpasswd

# the following is needed to keep smbclient from spouting spurious errors

# when samba is built with support for ssl.

;   ssl ca certfile = /usr/share/ssl/certs/ca-bundle.crt

.....

 

/* -------------------------------------------------------------------------- **

 *

 * module name: params

 *

 * -------------------------------------------------------------------------- **

 *

 *  this module performs lexical analysis and initial parsing of a

 *  windows-like parameter file.  it recognizes and handles four token

 *  types:  section-name, parameter-name, parameter-value, and

 *  end-of-file.  comments and line continuation are handled

 *  internally.

 *

 *  the entry point to the module is function pm_process().  this

 *  function opens the source file, calls the parse() function to parse

 *  the input, and then closes the file when either the eof is reached

 *  or a fatal error is encountered.

 *

 *  a sample parameter file might look like this:

 *

 *  [section one]

 *  parameter one = value string

 *  parameter two = another value

 *  [section two]

 *  new parameter = some value or t´other

 *

 *  the parameter file is divided into sections by section headers:

 *  section names enclosed in square brackets (eg. [section one]).

 *  each section contains parameter lines, each of which consist of a

 *  parameter name and value delimited by an equal sign.  roughly, the

 *  syntax is:

 *

 *    <file>            :==  { <section> } eof

 *

 *    <section>         :==  <section header> { <parameter line> }

 *

 *    <section header>  :==  ´[´ name ´]´

 *

 *    <parameter line>  :==  name ´=´ value ´\n´

 *

 *  blank lines and comment lines are ignored.  comment lines are lines

 *  beginning with either a semicolon (´;´) or a pound sign (´#´).

 *


...   下一页
 ·perl里字符串长度的取法    »显示摘要«
    摘要:perl好像没有提供strlen函数,用rindex函数可以同样得到字符串的长度。 $str = "abcd 1234"; $len = rindex $str."\$", "\$"; print "$len\n"; 执行结果: lenght of ´abcd 1234´ is: ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE