我在可重用的操作中有以下VBScript:
'Gather links
Browser("1").Navigate "http://InternalWebmail/something/inbox.nsf"
set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
set links = Browser("1").Page("Webmail").ChildObjects(oDesc)
Dim links2
links2 = ""
'Filter out irrelevant links
For i = 0 To links.Count-1
If lcase(trim(links(i).GetROProperty("text"))) = lcase(trim(DataTable("ExpectedFrom", dtGlobalSheet))) Then
links2 = links2 + "," + links(i).GetROProperty("url")
End If
Next
Dim final
final = split(mid(links2,2),",") 'Remove leading comma and split into array
'For each link (i.e. for each E-mail received):
'Effectively giving a reusable action an input parameter, I hope
For i = …Run Code Online (Sandbox Code Playgroud) 我正在通过更改内容类型来创建Excel报告.
Response.ContentType = "application/vnd.ms-excel"
Run Code Online (Sandbox Code Playgroud)
我的值包含前导零.问题是当导出到excel时,缺少前导零.
例如
000123 - > 123
我知道这可以通过excel手动更改.问题是如何以编程方式完成此操作?
由于VBScript不支持lookbehinds,我正在寻找替代解决方案.
我有字符串'\ E\F \'.
我想用'〜'替换\ F \,但只有在它没有\ E之前.
替换后,我希望'\ E\F \'为'\ E\F \'.
如果字符串是'randomText\F \',我希望它在替换后看起来像'randomText~'.
解:
我刚刚决定StrReverse它并做一个负面的前锋预测.这不是最优雅的解决方案,但它似乎适用于这种情况.
Dim regEx, str1
str1 = StrReverse("The quick \F\ brown \E\F\ dog.")
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Pattern = "\\F\\(?!E\\)"
regEx.Global = True
ReplaceTest = regEx.Replace(str1, "%")
Run Code Online (Sandbox Code Playgroud) 我的老板已经要求我转换一个vb脚本,每周五手动运行到python中,除非他想要自动化.我是编程新手,想要一些帮助来决定如何解决这个问题.这将是我的第一个真正的编程项目,fortunatley没有实时限制.
上下文:我们有一个ESRI Flexviewer,用于在我们的组织中显示地图.有问题的脚本采用折线,计算线的角度,然后计算流向.它通过在折线要素类中使用to和from字段并在每个管道的中点放置方向箭头来完成此操作.
我已经粘贴了下面的脚本...它有点长,但任何帮助将不胜感激!
所以我要求的是关于如何攻击它的建议.刚开始.我列出了VB脚本使用的主要进程吗?我是否绘制了流程图并编写了python的psydo代码?我应该识别主要过程,例如循环?并使用它作为框架开始?
Imports System.Runtime.InteropServices
Imports System.Drawing
Imports ESRI.ArcGIS.ADF.BaseClasses
Imports ESRI.ArcGIS.ADF.CATIDs
Imports ESRI.ArcGIS.Display
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.Catalog
Imports ESRI.ArcGIS.CatalogUI
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.SystemUI
Imports System.Windows
<ComClass(CmdFlowCreation.ClassId, CmdFlowCreation.InterfaceId, CmdFlowCreation.EventsId), _
ProgId("FlowArrows.CmdFlowCreation")> _
Public NotInheritable Class CmdFlowCreation
Inherits BaseCommand
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public …Run Code Online (Sandbox Code Playgroud) 我想用vbscript打开一个Internet Explorer页面,目前我的脚本如下
Dim IE
Dim MyDocument
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 0
IE.navigate "https://google.com"
Run Code Online (Sandbox Code Playgroud)
这很好用.问题是我需要获得我的网页(google.com)的响应,即其内容的字符串格式
我知道这主要是胡言乱语,但我需要它来处理我的工作
谢谢
我试图使用的代码就是这个.
Dim oNode
Set oNode = XmlDoc.SelectSingleNode("/Record/CelloXml/Integration/Case/Hearing/Court/NodeID")
Dim iIndex
Set iIndex = (CInt((oNode.Text).substring(0,1))) - 1
Run Code Online (Sandbox Code Playgroud)
我想使用它iIndex来决定arraylist中的元素以返回到父应用程序.
我目前得到的错误是我需要一个文本对象 oNode.Text
我在这做错了什么?
为什么可以迭代ArrayList使用For Each而不是Hashtable?
Dim i
For Each i In CreateObject("System.Collections.ArrayList") ' no error
Next
For Each i In CreateObject("System.Collections.Hashtable") ' error
Next
Run Code Online (Sandbox Code Playgroud)
迭代HashTable给出
Object不支持此属性或方法.
我需要一个脚本,最好是Windows Server的vbscript,它将文件夹中的文件存档到另一个文件夹.从说\\folder1\来\\folder1\archive\
这些文件的扩展名为.doc和.xls
但我也只想移动超过30天的文件.
有一个简单的方法吗?
如何将数据发布order.asp到第三方网址?
我在表单标签中有所有参数.
在提交第三方希望我添加两个值作为标题.第三方代码如下
curl https://www.instamojo.com/api/1.1/payment-requests/ \
--header "X-Api-Key: [API_KEY]" \
--header "X-Auth-Token: [AUTH_TOKEN]" \
--data
"allow_repeated_payments=False&amount=2500&buyer_name=John+Doe&purpose=FIFA+16&redirect_url=http%3A%2F%2Fwww.example.com%2Fredirect%2F&phone=9999999999&send_email=True&webhook=http%3A%2F%2Fwww.example.com%2Fwebhook%2F&send_sms=True&email=foo%40example.com"
Run Code Online (Sandbox Code Playgroud)
我正在使用asp经典.我可以用response.AddHeader name,value传递两个值X-Api-Key和X-Auth-Token?
如果不可能,那么如何在asp经典中使用curl?
我正在尝试编写一个批处理+ hta混合脚本,它允许我将变量从脚本的批处理部分传递到hta部分,这样我就可以生成像计算机型号等的东西.
这是我到目前为止 - 批次:
<!-- :: Batch section
@echo off
Pushd "%~dp0"
setlocal
FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Model /value') do SET model=%%A
for /F "delims=" %%a in ('mshta.exe "%~F0" "%model%"') do set "HTAreply=%%a"
echo End of HTA window, reply: "%HTAreply%"
goto :EOF
-->
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我尝试将其%model%用作参数,并尝试arg1在我的VBScript部分中尝试使用该变量 - 但它不起作用.
所以在我的hta部分中,这是我的vbscript:
<script language="VBScript">
MsgBox arg1
</script>
Run Code Online (Sandbox Code Playgroud)
这只是打开一个空盒子.
我一直在寻找一段时间在线试图找到一种方法来做到这一点,我无法弄明白.我之前解决这个问题的方法基本上是创建一个批处理脚本来创建一个新文件,即hta和batch hybrid,但我想避免为了简单起见而这样做.
任何帮助将非常感激