求各位大神帮忙,利用sharepoint web service 上傳圖片到sharepoint服務器站點上的圖片庫中,图片怎么上传呀,我怎么老是上传不了呀
------解决方案--------------------
楼主这个看过没?
------解决方案--------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Microsoft.SharePoint;
using yesinda.yesindakms.sharepoint;
public partial class usercontrol_ImageList : System.Web.UI.UserControl
{
public string ReturnValue = String.Empty;
public string FolderPath = "111";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetFolder();
BindGrid();
}
}
/// <summary>
/// 创建数据源
/// </summary>
/// <returns></returns>
ICollection CreateDataSource()
{
DataTable dt = new DataTable(); //创建一个名为mytable的DataTable对象形
DataColumn dc = new DataColumn(); //创建一个列对象
dc.DataType = System.Type.GetType("System.Int32"); //指定该列的数据类型
dc.AutoIncrement = true; //该列为自动增涨列
dc.AutoIncrementSeed = 1; //初始值
dc.AutoIncrementStep = 2; //增量
dc.Caption = "id"; //设置列的标题
dc.ColumnName = "序号"; //设置 列集合对象中的列的名称,datagrid中显示该列名.
dc.Unique = true; //为此列创建唯一性约
dc.AllowDBNull = false; //不允许为空
dt.Columns.Add(dc); //将该列对象加入到表mytable的列集合中
//普通列
DataColumn dc1 = new DataColumn();
dc1.DataType = System.Type.GetType("System.String");
dc1.AllowDBNull = false;
dc1.Caption = "path";
dc1.ColumnName = "路径";
dc1.DefaultValue = 25;
dt.Columns.Add(dc1);
DataColumn dc2 = new DataColumn();
dc2.DataType = System.Type.GetType("System.String");
dc2.AllowDBNull = false;
dc2.Caption = "path";
dc2.ColumnName = "完整路径";
dc2.DefaultValue = 25;
dt.Columns.Add(dc2);
SPSite sps = yesinda.yesindakms.sharepoint.List.ListLib.findParamSite("/sites/TQOA/", this.Context);
sps.AllowUnsafeUpdates = true;
SPWeb spw = sps.OpenWeb();
spw.AllowUnsafeUpdates = true;