zoukankan      html  css  js  c++  java
  • 读列表库附件地址

     if (item.Attachments.Count > 0)
                {
                    for (int a = 0; a < item.Attachments.Count; a++)
                    {
                        if (a == 0)
                        {
                            this.Label1.Text = "附件 1:<a href=" + item.Attachments.UrlPrefix + item.Attachments[a] + " target=_blank>[" + item.Attachments[a] + "]</a><br>";
                        }
                        else if (a == 1)
                        {
                            this.Label2.Text = "附件 2:<a href=" + item.Attachments.UrlPrefix + item.Attachments[a] + " target=_blank>[" + item.Attachments[a] + "]</a><br>";
                        }
                        else if (a == 2)
                        {
                            this.Label3.Text = "附件 3:<a href=" + item.Attachments.UrlPrefix + item.Attachments[a] + " target=_blank>[" + item.Attachments[a] + "]</a>";
                        }
                    }
                } 

    上传

    if (FileUpload1.PostedFile != null)
            {
                SPSite spsite = new SPSite("http://" + Page.Request.Url.Host.ToString().Trim() + "/sites/RapexChina/AvisoManage/Lists/List9/");
                SPWeb spweb = spsite.OpenWeb();
                Stream stream = FileUpload1.PostedFile.InputStream;

                byte[] buffer = new byte[stream.Length];
                stream.Read(buffer, 0, (int)stream.Length);
                stream.Close();

                spweb.Files.Add("http://" + Page.Request.Url.Host.ToString().Trim() + "/sites/RapexChina/AvisoManage/Lists/List9/", buffer);
            }


    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/kxlf4600/archive/2008/12/26/3610406.aspx


    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/kxlf4600/archive/2008/12/26/3610407.aspx

  • 相关阅读:
    随记
    bzoj3551 [ONTAK2010]Peaks加强版
    bzoj2763 [JLOI2011]飞行路线
    bzoj1758 [Wc2010]重建计划
    bzoj1857 [Scoi2010]传送带
    bzoj4519 [Cqoi2016]不同的最小割
    bzoj2229 [Zjoi2011]最小割
    bzoj4129 Haruna’s Breakfast
    bzoj1835 [ZJOI2010] 基站选址
    bzoj2160 拉拉队排练
  • 原文地址:https://www.cnblogs.com/IsNull/p/1897116.html
Copyright © 2011-2022 走看看