小编San*_*osh的帖子

在Excel VBA代码中处理XMLHttp响应中的JSON对象

我需要处理一个JSON对象,它是Excel VBA中XMLHTTPRequest的响应.我写了下面的代码,但它不起作用:

  Dim sc As Object
  Set sc = CreateObject("ScriptControl")
  sc.Language = "JScript"

  Dim strURL As String: strURL = "blah blah"

  Dim strRequest
  Dim XMLhttp: Set XMLhttp = CreateObject("msxml2.xmlhttp")
  Dim response As String

  XMLhttp.Open "POST", strURL, False
  XMLhttp.setrequestheader "Content-Type", "application/x-www-form-urlencoded"
  XMLhttp.send strRequest
  response = XMLhttp.responseText
  sc.Eval ("JSON.parse('" + response + "')")
Run Code Online (Sandbox Code Playgroud)

我收到错误运行时错误'429'ActiveX组件无法在行中 创建对象Set sc = CreateObject("ScriptControl")

解析JSON对象后,如何访问JSON对象的值?

PS My JSON对象示例: {"Success":true,"Message":"Blah blah"}

excel vba json xmlhttprequest excel-vba

15
推荐指数
2
解决办法
7万
查看次数

Excel 2010中的共享字符串

有人可以帮我理解MS Excel中的共享字符串吗?我试图理解使用一些博客,但无法完全了解.每个人都在解释如何使用Open XML访问共享字符串以及存储共享字符串的位置(作为sharedstrings.xml).使用API​​访问很好.但,

  1. 如何在Excel中创建共享字符串.(在EXCEL 2010中手动创建,不使用API​​)
  2. 共享字符串的确切需求是什么?
  3. 在哪些情况下,我可以去共享字符串?

我试过跟随.

http://www.sadev.co.za/content/reading-and-writing-excel-2007-or-excel-2010-c-part-iii-shared-strings

http://msdn.microsoft.com/en-us/library/gg278314.aspx

ms-office openxml excel-2010 openxml-sdk

9
推荐指数
1
解决办法
5652
查看次数

ng-switch-when with ng-repeat

我的HTML代码是

<tr ng-switch-when="true" ng-repeat="onlineCredentials in onlineCredentialDetails" >
        <td>
            <span>Ordering Mode: </span>{{onlineCredentials.mode}}<br />
            <span>Intermedtiary Group: </span>{{onlineCredentials.name}}
        </td>
        <td>
            <span>Website: </span>{{onlineCredentials.webSite}}
        </td>
        <td >
            <span>Username / Password</span>
            <div ng-repeat="cred in onlineCredentials.loginDetails">
                -&nbsp;{{cred.userName}}&nbsp;/&nbsp;{{cred.password}}
            </div><br />
        </td>
    </tr>
Run Code Online (Sandbox Code Playgroud)

哪个不是绑定数据...(TD和文本存在但绑定属性值为空)

如何一次使用ng-switch-when和ng-repeat?

提前致谢

angularjs ng-switch angularjs-ng-repeat

6
推荐指数
2
解决办法
2万
查看次数

如何在ASP.NET页面中实现异步加载?

如何在ASP.NET页面中实现异步加载?

我的ASP.NET页面中有3个部分.所有部分都是独立的.

LoadSection1();
LoadSection2();
LoadSection3();
Run Code Online (Sandbox Code Playgroud)

每个部分大约需要15秒.我想使用异步加载减少页面加载时间.

我试过Threads

// Create thread jobs for each section
ThreadStart PipelinePerformanceThreadJob = new ThreadStart(LoadPipelineSection);
ThreadStart CampaignPerformanceThreadJob = new ThreadStart(LoadCampaignSection);
ThreadStart OperationalThreadJob = new ThreadStart(LoadOperationalSection);

// Create threads
Thread PPThread = new Thread(PipelinePerformanceThreadJob);
Thread CSThread = new Thread(CampaignPerformanceThreadJob);
Thread OSThread = new Thread(OperationalThreadJob);

// Start all the threads
PPThread.Start();
CSThread.Start();
OSThread.Start();

// Join threads with main thread
PPThread.Join();
CSThread.Join();
OSThread.Join();
Run Code Online (Sandbox Code Playgroud)

页面在完成所有线程后加载.但是每当我从线程得到响应时,我都需要显示每个部分的数据.例如,如果Thread1完成,我想显示Section1的数据(即使thread2和3仍在运行.).我怎样才能在.NET中实现这一目标?

.net c# asp.net multithreading asynchronous

2
推荐指数
1
解决办法
2727
查看次数