Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
如果尚未监听指定端口,则启动新的 dbmlsync 服务器。
Public Function StartServer( ByVal port As Int32, ByVal cmdline As String, ByVal timeout As UInt32, ByVal starttype As DBSC_StartType ) As Boolean
public Boolean StartServer( Int32 port, String cmdline, UInt32 timeout, out DBSC_StartType starttype )
port 检查是否已有 dbmlsync 服务器的 TCP 端口。如果启动新服务器,则它会被设置为监听此端口。
cmdline 用于启动 dbmlsync 服务器的有效命令行。此命令行仅能包含以下选项(这些选项对于 dbmlsync 实用程序具有相同的含义):-a、-c、-dl、-do、-ek、-ep、-k、-l、-o、-os、-ot、-p、-pc+、-pc-、-pd、-pp、-q、-qi、-qc、-sc、-sp、-uc、-ud、-ui、-um、-un、-ux、-v[cnoprsut]、-wc、-wh。必须指定 -c 选项。
timeout dbmlsync 服务器启动后到其可接受请求所需的最长等待时间,以毫秒为单位。使用 DbmlsyncClient.DBSC_INFINITY 可无限期等待响应。
starttype 为指示服务器是否已定位或启动而设置的输出参数。如果 starttype 为非空条目并且 StartServer 返回 true,则退出时 starttype 指向的变量被设置为 DBSC_StartType 枚举中的值。
服务器已运行或成功启动时返回 true;否则返回 false。返回 false 时,您可调用 GetErrorInfo 方法获取有关失败的详细信息。
如果存在服务器,该方法将 starttype 参数设置为 DBSC_SS_ALREADY_RUNNING 并且不执行进一步动作即返回。如果未找到服务器,则此方法使用由 cmdline 参数所指定的选项启动一个新的服务器并在返回前等待其开始接受请求。
在 Windows Mobile 设备中,在成功调用 StartServer 之前,通常需要设置 server path 属性。在以下实例中不需要设置 server path 属性:
应用程序与 dbmlsync.exe 位于同一目录。
dbmlsync.exe 位于 Windows 目录。