积极答复者
如何實現在產品檔顯示圖片?

问题
答案
-
http://www.cnblogs.com/caims/archive/2009/04/12/1434239.html
Batistuta Cai-刀客 | 蔡敏生 | MS CRM MVP | Blog:http://caims.cnblogs.com- 已标记为答案 Jim Wang (Microsoft)Microsoft employee, Moderator 2009年7月8日 13:26
全部回复
-
http://www.cnblogs.com/caims/archive/2009/04/12/1434239.html
Batistuta Cai-刀客 | 蔡敏生 | MS CRM MVP | Blog:http://caims.cnblogs.com- 已标记为答案 Jim Wang (Microsoft)Microsoft employee, Moderator 2009年7月8日 13:26
-
刀客的方法很妙:用CRM的附件功能转来显示图片。我之前做过CRM 3.0 和WSS 3.0 的整合,当时的要求是:每个Account都有对应的图片库,图片库我选用的是Windows SharePoint Services 3.0中的Picture Library,之所以选择WSS 3.0是因为免费,自带于Windows Server 2003 r2 里。
在CRM部分要用到IFRAME,并向编辑好的aspx传递参数;
在WSS部分要用到Content Editor来把WSS的Picture Library界面无缝整合到CRM。
aspx文件精简后的代码如下:Integrate CRM with WSS 3.0 Picture Library
public partial class _Default : System.Web.UI.Page { string accountGUID = ""; protected void Page_Load(object sender, EventArgs e) { string entityId = Request.QueryString["oId"]; Guid accountId = (entityId == null) ? (new Guid("00000000-0000-0000-0000-000000000000")) : new Guid(entityId); accountGUID = accountId.ToString(); string url = "http://WSS:6666/PL/" + accountGUID; // PL is a picture library in WSS 3.0 if (CheckUrl(url)) { Response.Redirect(url); } else { Label1.Text = "This account doesn't has a Pictures Library, please create a one for it."; } } public static bool CheckUrl(string url) { //check if the url(pictures library) is existing HttpWebResponse httpResponse = null; try { HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(url); httpRequest.Credentials = System.Net.CredentialCache.DefaultCredentials; httpResponse = (HttpWebResponse)httpRequest.GetResponse(); return (httpResponse.StatusCode == System.Net.HttpStatusCode.OK); } catch (Exception ex) { return false; } } protected void Button1_Click(object sender, EventArgs e) { //Response.Redirect("http://WSS:6666/PL/Forms/Upload.aspx?Type=1"); SPSite Site = new SPSite("http://WSS:6666"); //site url SPWeb Web = Site.OpenWeb(); Site.AllowUnsafeUpdates = true; Web.AllowUnsafeUpdates = true; SPFolder rootFolder = Web.GetFolder("PL"); // PL is a picture library in WSS 3.0 rootFolder.SubFolders.Add(accountGUID); Page_Load(null, null); } }
Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com , http://mscrm.cn