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

  • 相关阅读:
    python 学习分享-进程
    python 学习分享-实战篇类 Fabric 主机管理程序开发
    python 学习分享-线程
    python 学习分享-paramiko模块
    linux ubuntu开启sshd
    python 学习分享-实战篇高级的ftp
    python 学习分享-socketserver
    python 学习分享-socket编程
    Java学习笔记--Java开发坏境搭建
    C# 泛型
  • 原文地址:https://www.cnblogs.com/IsNull/p/1897116.html
Copyright © 2011-2022 走看看