增量计数器循环(Increment counter with loop)
这个问题与我以前的问题有关:
Jsp迭代槽对象列表
我想插入从我的for循环中从0开始的计数器,我已经尝试了几个组合:
1。
<c:forEach var="tableEntity" items='${requestScope.tables}'> <c:forEach var="rowEntity" items='${tableEntity.rows}' varStatus="count"> <c:out value="${count}" /> </c:forEach> </c:forEach>
2。
<c:set var="count" value="0" scope="page" /> <c:forEach var="tableEntity" items='${requestScope.tables}'> <c:forEach var="rowEntity" items='${tableEntity.rows}'> <%=count++%> <c:out value="${count}" /> </c:forEach> </c:forEach>
第一种方法的问题是外部循环有3个项目,内部循环有7个项目,因此对于每个外部项目,计数从0开始。第二个我得到编译错误。 这基本上是我想要的:
counter = 0; outer for loop inner for loop counter++; //cout/echo/print counter value should start from 0 end inner loop end outer loop
我只是不完全熟悉语法。 谢谢
This question is related to my previous question :
Jsp iterate trough object list
I want to insert counter that starts from 0 in my for loop, I've tried several combinations so far :
1.
<c:forEach var="tableEntity" items='${requestScope.tables}'> <c:forEach var="rowEntity" items='${tableEntity.rows}' varStatus="count"> <c:out value="${count}" /> </c:forEach> </c:forEach>
2.
<c:set var="count" value="0" scope="page" /> <c:forEach var="tableEntity" items='${requestScope.tables}'> <c:forEach var="rowEntity" items='${tableEntity.rows}'> <%=count++%> <c:out value="${count}" /> </c:forEach> </c:forEach>
Problem with first approach is that outer loop has 3 items and inner loop has 7 items, so for each outer item the count starts from 0. The second one I get compile error. Here is basically what I want :
counter = 0; outer for loop inner for loop counter++; //cout/echo/print counter value should start from 0 end inner loop end outer loop
I'm just not totally familiar with the syntax. thank you
原文:https://stackoverflow.com/questions/4862605
最满意答案
为了达到这个目的,你可以对你的SharePoint URL执行一个Web请求,然后捕获一个主机头。
有一个名为MicrosoftSharePointTeamServices的主机标题,它将为您提供SharePoint版本。
见下文:
using System; using System.Net; class C { static void Main(string[] args) { var uri = new Uri(args[0]); var wc = new WebClient(); wc.UseDefaultCredentials = true; wc.DownloadString(uri); var sharePointVersion = wc.ResponseHeaders["MicrosoftSharePointTeamServices"]; Console.WriteLine(sharePointVersion); } }
然后将您的SharePointVersion与以下列表进行比较:
12.0.0.6535 MOSS 20071或WSS 3.0 SP2 + 2009年12月累计更新(KB960010 + KB960011)
12.0.0.6524 MOSS 20071或WSS 3.0 SP2 + 12月15日更新(KB977027 + KB977026)
12.0.0.6520 MOSS 20071或WSS 3.0 SP2 + 2009年10月累计更新(KB974989 + KB974988)
12.0.0.6514 MOSS 20071或WSS 3.0 SP2 + 2009年8月累计更新(KB973400 + KB973399)
12.0.0.6510 MOSS 20071或WSS 3.0 SP2 + 2009年6月累计更新(KB971538 + KB971537)
12.0.0.6504 MOSS 20071或WSS 3.0 SP2 + 2009年4月累计更新(KB968850 + KB968851)
12.0.0.6421 MOSS 20071或WSS 3.0 SP2(KB953338 + KB953334)[已更新2009年8月1日:SP2下载现在包含修复激活问题的修补程序(KB971620)更多信息,请访问Microsoft SharePoint团队博客]
12.0.0.6341 MOSS 20071或WSS 3.0 2009年2月累计更新(KB961755 + KB961756)
12.0.0.6335 MOSS 20071或WSS 3.0 2008年12月累计更新(KB960010 + KB960011)
12.0.0.6331 MOSS 20071或WSS 3.0 October 08累积更新(KB957691 + KB957693,KB958567和KB958569)
12.0.0.6327 MOSS 20071或WSS 3.0 08年8月累积更新(KB956056和KB956057)
12.0.0.6318 MOSS 20071或WSS 3.0基础结构更新(KB951695和KB951297)
12.0.0.6303 MOSS 20071或WSS 3.0 SP1后修补程序(KB948945)
12.0.0.6301 MOSS 20071或WSS 3.0 SP1后修补程序(KB941274)
12.0.0.6300 MOSS 20071或WSS 3.0 SP1后修补程序(KB941422)
12.0.0.6219 MOSS 20071或WSS 3.0 SP1
12.0.0.6039 MOSS 20071或WSS 3.0 10月公开更新
12.0.0.6036 MOSS 20071或WSS 3.0 2007年8月24日修复程序包
12.0.0.4518 MOSS 20071或WSS 3.0 RTM
12.0.0.4407 MOSS 20071或WSS 3.0 Beta 2 TR
12.0.0.4017 MOSS 20071或WSS 3.0 Beta 2
12.0.0.3111 Office 12(PDC映像 - pre-beta) - 此版本的Office在“添加/删除程序”对话框中没有支持链接。
To achieve this you can execute a web request to your SharePoint URL and then capture a host header.
There is a host header called MicrosoftSharePointTeamServices that will provide you with the SharePoint version.
See below:
using System; using System.Net; class C { static void Main(string[] args) { var uri = new Uri(args[0]); var wc = new WebClient(); wc.UseDefaultCredentials = true; wc.DownloadString(uri); var sharePointVersion = wc.ResponseHeaders["MicrosoftSharePointTeamServices"]; Console.WriteLine(sharePointVersion); } }
Then compare your SharePointVersion with the following list:
12.0.0.6535 MOSS 20071 or WSS 3.0 SP2 + December 09 cumulative Update (KB960010 + KB960011)
12.0.0.6524 MOSS 20071 or WSS 3.0 SP2 + 15th December Update (KB977027 + KB977026)
12.0.0.6520 MOSS 20071 or WSS 3.0 SP2 + October 09 cumulative Update (KB974989 + KB974988)
12.0.0.6514 MOSS 20071 or WSS 3.0 SP2 + August 09 cumulative Update (KB973400 + KB973399)
12.0.0.6510 MOSS 20071 or WSS 3.0 SP2 + June 09 cumulative Update (KB971538 + KB971537)
12.0.0.6504 MOSS 20071 or WSS 3.0 SP2 + April 09 cumulative Update (KB968850 + KB968851)
12.0.0.6421 MOSS 20071 or WSS 3.0 SP2 (KB953338 + KB953334) [Updated 1st Aug 09: SP2 download now includes the hotfix (KB971620) that corrects the activation issue more information on the Microsoft SharePoint team blog]
12.0.0.6341 MOSS 20071 or WSS 3.0 February 09 cumulative Update (KB961755 + KB961756)
12.0.0.6335 MOSS 20071 or WSS 3.0 December 08 cumulative Update (KB960010 + KB960011)
12.0.0.6331 MOSS 20071 or WSS 3.0 October 08 cumulative Update (KB957691 + KB957693,KB958567 and KB958569)
12.0.0.6327 MOSS 20071 or WSS 3.0 August 08 cumulative update (KB956056 & KB956057)
12.0.0.6318 MOSS 20071 or WSS 3.0 Infrastructure Update (KB951695 & KB951297)
12.0.0.6303 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB948945)
12.0.0.6301 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB941274)
12.0.0.6300 MOSS 20071 or WSS 3.0 post-SP1 hotfix (KB941422)
12.0.0.6219 MOSS 20071 or WSS 3.0 SP1
12.0.0.6039 MOSS 20071 or WSS 3.0 October public update
12.0.0.6036 MOSS 20071 or WSS 3.0 August 24, 07 hotfix package
12.0.0.4518 MOSS 20071 or WSS 3.0 RTM
12.0.0.4407 MOSS 20071 or WSS 3.0 Beta 2 TR
12.0.0.4017 MOSS 20071 or WSS 3.0 Beta 2
12.0.0.3111 Office 12 (PDC image - pre-beta) - This version of Office does not have a support link in the Add/Remove programs dialog box.
相关问答
更多-
通过内置的Web服务将文件上传到SharePoint(Upload a file to SharePoint through the built-in web services)[2023-04-29]
使用WSS“复制”Web服务将文档上传到库中的示例... public static void UploadFile2007(string destinationUrl, byte[] fileData) { // List of desination Urls, Just one in this example. string[] destinationUrls = { Uri.EscapeUriString(destinationUrl) }; // Empty Field I ... -
很遗憾,没有简单的方法可以找出您正在运行的SharePoint 2013的版本(SKU)。 为了弄清楚,你必须挖掘注册表: 打开Regedit 导航到HKLM \ SOFTWARE \ Microsoft \ Shared Tools \ Web Server Extensions \ 15.0 \ WSS \ InstalledProducts 比较指导与这些: C5D855EE-F32B-4A1C-97A8-F0A28CE02F9C - SharePoint Server 2013 CBF97833-C ...
-
如何使用SharePoint Web服务确定SharePoint版本?(How to determine SharePoint version using SharePoint web services?)[2023-12-21]
为了达到这个目的,你可以对你的SharePoint URL执行一个Web请求,然后捕获一个主机头。 有一个名为MicrosoftSharePointTeamServices的主机标题,它将为您提供SharePoint版本。 见下文: using System; using System.Net; class C { static void Main(string[] args) { var uri = new Uri(args[0]); var wc = new WebClient() ... -
根据您的Web部件使用的确切功能和功能,它可能无需更改即可运行。 看看我写的关于将2007年解决方案移植到2010年的这一系列文章 。 Depending on the exact functionality and features used by your web part, it may work without change. Have a look at this series of articles that I wrote about porting a 2007 solution to 20 ...
-
假设你想要一个使用Visual Studio和C#的代码解决方案 将Web引用添加到您的SharePoint列表Web服务[ http:// [server-url] /_vti_bin/lists.asmx ] 创建一个类似下面的新类: using System; using System.Text; using System.Xml; using System.Text.RegularExpressions; using System.Net; public class Sha ...
-
wsLists.AddAttachment(this.ListName, listItemID, safeFileName(attachment.Name), File.ReadAllBytes(attachment.FullName)); safeFileName function = private string safeFileName(string filename) { filename = filename.Replace(@"\", ""); ...
-
这完全取决于,如果SharePoint使用AD,那么我在使用SharePoint进行身份验证时看不到任何附加值。 如果SharePoint使用基于表单的身份验证,我会创建一个在SharePoint服务器上运行的自定义Web服务,以允许您对用户进行身份验证。 这样,如果你再次需要它的另一个应用程序,你可以使用该webservice / wcf服务。 It all depends, if SharePoint uses AD then I see no added value in authenticating ...
-
如何使用sharepoint Web服务调用sharepoint工作流(How can I invoke a sharepoint workflow using sharepoint web service)[2023-10-06]
调用此函数传递指定的参数: static void StartWorkflow(SPListItem listItem, SPSite spSite, string wfName) { SPList parentList = listItem.ParentList; SPWorkflowAssociationCollection associationCollection = parentList.WorkflowAssociations; f ... -
嗯,这不是一个很好的答案,问题“我怎么能确定原因......”但这对我有用。 我所做的是在反射器中打开包含Lists服务实现的程序集STSSOAP.dll。 我复制了相关代码,以便在我自己的服务中实现自己的GetListItems方法。 幸运的是,实际的Lists.GetListItems方法代码是最小的,只是调用其他SharePoint方法,甚至更幸运,这些方法和成员都被公开,所以我能够做到这一点。 然后我在服务器上用我的版本替换了Lists.asmx,并附加调试器以获取一些信息。 我发现我的身份验证co ...
-
我发现这些作品非常令人沮丧,但却很成功。 在Windows机器上启动Visual Studio,启动旧式.Net 2.0 Windows窗体应用程序,并连接到相同的WSDL 。 这将创建一个新的Reference.cs文件。 将该文件带入您的MonoTouch应用程序。 修改构造函数以使用OLD MonoTouch构造,因为.Net 2.0将无法编译。 导入的构造函数 ///
public Lists() { *this.Url = global::test.P ...