我需要将IP地址拉出到VBA宏中.此代码有效,但命令对话框可以短暂显示,这看起来并不好看.我可以使用修改"静默"吗?
Sub getIP()
Set objShell = CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("%comspec% /c ipconfig.exe")
Do Until objExecObject.StdOut.AtEndOfStream
strLine = objExecObject.StdOut.ReadLine()
strIP = InStr(strLine, "Address")
If strIP <> 0 Then
IPArray = Split(strLine, ":")
strIPAddress = IPArray(1)
End If
Loop
SynapseForm.LabelIP.Caption = strIPAddress
End Sub
Run Code Online (Sandbox Code Playgroud)
更新,找到一个使用Wscript.Shell写入临时文件的变体,这个"默默地"工作不如下面Remou的方法那么好
Sub getIPAddress()
Dim IP_Address: IP_Address = GetIP()
If IP_Address = "0.0.0.0" Or IP_Address = "" Then
MsgBox "No IP Address found.", , ""
Else
MsgBox IP_Address
'MsgBox IP_Address, , "IP address"
End If
End Sub …Run Code Online (Sandbox Code Playgroud) 这不太有效,我将文本选择为 Ok 但需要将其读入变量。
Sub findTest()
Dim firstTerm As String
Dim secondTerm As String
Dim myRange As Range
Dim selRange As Range
Dim selectedText As String
Set myRange = ActiveDocument.Range
firstTerm = "<patientFirstname>"
secondTerm = "</patientFirstname>"
With myRange.Find
.Text = firstTerm
.MatchWholeWord = True
.Execute
myRange.Collapse direction:=wdCollapseEnd
Set selRange = ActiveDocument.Range
selRange.Start = myRange.End
.Text = secondTerm
.MatchWholeWord = True
.Execute
myRange.Collapse direction:=wdCollapseStart
selRange.End = myRange.Start
selectedText = selRange.Select
End With
End Sub
Run Code Online (Sandbox Code Playgroud)
我试图从一个小的伪 xml 数据包中提取数据,因此搜索字符串在每个 word 文档中只会出现一次。
到目前为止,我所有的(家庭)CF学习都是使用Access作为数据库完成的,就DB而言,我"得到它".没有数据库服务器,也不需要登录数据库或任何东西,并且设置表关系很容易和直观.哦,它基本上可以自由部署.
但是,我现在正在研究一种可能在多个企业中使用的应用程序,可能最多可以使用50个并发用户.我听说Access真的不适合多用户使用或在应用程序上使用生产.你会推荐哪种更适合,最好是易于掌握,我的SQL需要最小的调整(我使用的工具转换为MySQL,它肯定处理串联不同,我不想做太多的调试),可视化界面可用,可扩展,可备份,以及我还需要的其他任何我还不知道的东西!
根据问题,尝试替换形式的Word文档中的文本范围
"<start>..........<end>"
可变长度.它只会在文档中出现一次.
我正在考虑尝试解决表单和远程CFC安全性的想法我想知道设置一个非常长/永久的会话持续时间和使用
if DateDiff("n", now(), session.lastactive) gt 15
Run Code Online (Sandbox Code Playgroud)
在onRequest中处理会话超时.然后我可以在引用/调用页面中设置session.referrer并在表单处理程序或远程cfc中测试它.我还没有读到它已经完成,所以有可能有很好的理由不这样做?
我正在使用Ryan J. Heldt的验证CFC http://validation.riaforge.org/
我的表单提交到processSignup.cfc
<cfscript>
objValidation = createObject("component","cfcs.validation").init();
objValidation.setFields(form);
objValidation.validate();
</cfscript>
<!--- clear the error/success message --->
<cfset msg="">
<cfif objValidation.getErrorCount() is not 0>
<cfsavecontent variable="msg">
<H2>Error in form submission</H2>
<P>There were <cfoutput>#objValidation.getErrorCount()#</cfoutput> errors in your submission:</P>
<ul>
<cfloop collection="#variables.objValidation.getMessages()#" item="rr">
<li><cfoutput>#variables.objValidation.getMessage(rr)#</cfoutput></li>
</cfloop>
</ul>
<p>Please use the back button on your browser to correct your submission.</p>
</cfsavecontent>
</cfif>
<cfdump var="#objvalidation#">
<cfoutput>
#msg#
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
这给了我这个输出

我正在尝试弄清楚的是结构的名称以及如何获得"确认密码","密码","用户名",但我是密集的,我无法弄清楚如何.
<!---
<fusedoc fuse="Validation.cfc" language="ColdFusion" specification="2.0">
<responsibilities>
I am a ColdFusion Component that performs server-side …Run Code Online (Sandbox Code Playgroud)