我是整个 C# 和 Visual Studio 程序的新手。我的任务是使用 C# 创建一个 Windows 窗体应用程序以连接到 SharePoint 站点并从那里检索任何数据,例如列表、文件。我设计了我的应用程序,以便您可以手动添加所需的站点 url,然后单击一个按钮,这将生成一个包含站点中所有数据的 xml 文件。这是我需要设置我的 xml 的方式:
报告应为 csv 或 xml 格式,例如
<SiteCollection Name=”SiteCollection”>
<Web Name=”Web Name”>
<Library Name=”Library Name”>
<Document Name=”DocName1”/>
<Folder Name=”Folder Name”>
<Document Name=”DocName2”/>
<Document Name=”DocName3”/>
</Folder>
</Library>
<List Name=”List Name”>
<Web Name=”Web Name”>
<Library Name=”Library Name”>
<Document Name=”DocName1”/>
<Folder Name=”Folder Name”>
<Document Name=”DocName2”/>
<Document Name=”DocName3”/>
</Folder>
</Library>
<List Name=”List Name”>
</Web>
</Web>
</SiteCollection>
到目前为止,这就是我为我的应用程序设置代码的方式:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace SharePoint.College
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void btn1_Click(object sender, EventArgs e)
{
}
}
}
我只是在寻找一些建议和一些帮助来开始这件事。
感谢您的任何回复