??xml version="1.0" encoding="utf-8" standalone="yes"?>精品乱人伦一区二区三区,欧美成人明星100排名 ,精品国产乱码久久久久久1区2匹http://www.aygfsteel.com/zengke/category/16331.htmlzh-cnWed, 28 Feb 2007 07:42:10 GMTWed, 28 Feb 2007 07:42:10 GMT60sps的权限问?/title><link>http://www.aygfsteel.com/zengke/articles/84286.html</link><dc:creator>曄</dc:creator><author>曄</author><pubDate>Wed, 29 Nov 2006 03:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/zengke/articles/84286.html</guid><wfw:comment>http://www.aygfsteel.com/zengke/comments/84286.html</wfw:comment><comments>http://www.aygfsteel.com/zengke/articles/84286.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zengke/comments/commentRss/84286.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zengke/services/trackbacks/84286.html</trackback:ping><description><![CDATA[ <font size="2">q日遇到一个诡异的需求是q样?<br />某个客户需要做一个搜? 得到文档的信?br />q个文档库可能是带权限的, 需要在昄l果的时候判断当前用户在q个文档库上是否有权?br /><br />而这个文档库可能攑֜一个wss|站?br />只允怸个部门的入这个网? 但是该文档库可以l其他部门的人加权限以便查看其中的文?br /><br />以下是用对象模型的方法判断文档库上的权限:<br />一般来说首先想到的Ҏ肯定是这L:<br />SPSite site = new SPSite("</font> <a href="http://mysite_url/"> <font size="2">http://mysite_url</font> </a> <font size="2">");   // Line 1<br />SPWeb web = site.OpenWeb();                          // Line 2<br />SPListCollection lists = web.Lists;                       // Line 3<br />SPList list = lists["MyDocLib"];                            // Line 4<br />bool perm = list.Permissions.DoesUserHavePermission(SPRights.xxxx); <br /><br />但是, 对于上面提到的那U情? q种Ҏ是有问题?br />问题一:<br />该用户如果不是该|站成员的话, 上面的做法得不到|站<br />其表现就是webpart所在页面会反复弹出用户名密码框......即你做了try-catch也没? 截不下这个异?br />问题?<br />该用户不是该|站成员, 默认情况下不允许使用web.Lists[]q种Ҏ, 会有异常<br /><br />对于W一个问题解军_? 插入一行代?<br />site.CatchAccessDeniedException = false;    // Line 1.5<br />q个属性就像其名字一? ? 不罗嗦了, 是可以拿到那个SPWeb对象?br /><br />对于W二个问? 插入一行代?<br />lists.ListsForCurrentUser = true;        // Line 3.5<br />q样再用web.Lists[]p得到SPList对象, 然后再判权限p?br /><br />上面两个对象模型估计一般情况下都是用不上的...只有在某些诡异需求的情况下可能会用到<br /><br />转蝲QotecQErucy</font> <img src ="http://www.aygfsteel.com/zengke/aggbug/84286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zengke/" target="_blank">曄</a> 2006-11-29 11:20 <a href="http://www.aygfsteel.com/zengke/articles/84286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>TOOLPARThttp://www.aygfsteel.com/zengke/articles/83930.htmlMon, 27 Nov 2006 16:36:00 GMThttp://www.aygfsteel.com/zengke/articles/83930.htmlhttp://www.aygfsteel.com/zengke/comments/83930.htmlhttp://www.aygfsteel.com/zengke/articles/83930.html#Feedback0http://www.aygfsteel.com/zengke/comments/commentRss/83930.htmlhttp://www.aygfsteel.com/zengke/services/trackbacks/83930.html  我们在自定义的ToolPart中定义了一个文本框的字W串属性?/font>

    首先我们知道Q属性都是保存在WebPart中,所以我们需要在WebPart中徏立相应属性来保存此|如下Q?/font>

    

// q个属性是隐藏的,主要用于接收自定义的ToolPart中的自定义属性的?/span>
        [Browsable( false
),
            Category(
" Miscellaneous "
),
            DefaultValue(defaultText),
            WebPartStorage(Storage.Personal),
            FriendlyName(
" Text "
),
            Description(
" Text Property "
)]
        
public   string
 Text
        
{
            
get

            
{
                
return
 text;
            }


            
set

            
{
                text 
=
 value;
            }

        }


    
    要注意的一点就是这个属性是隐藏的,因ؓ我们不需要自带的WebPart昄出来Q所以将Browsable讄成false?

    然后我们需要在ToolPart中画出我们需要的文本框了。画个ToolPart的方法大安很熟悉了Q就是RenderToolPart代码如下Q?/font>


///   <summary>
        
///
 Render this tool part to the output parameter specified.
        
///   </summary>

        
///   <param name="output"> The HTML writer to write out to  </param>

         protected   override   void
 RenderToolPart(HtmlTextWriter output)
        
{
            ToolPane tp 
=   this
.ParentToolPane;
            CustomProps myWP 
=
 (CustomProps)tp.SelectedWebPart;
            
            output.Write(
" 误入信息:<input name=\ ""  

                 +  inputname  +   " \ "  type = \ " text\ "  value = \ ""   +
 myWP.Text
                
+   " \ " >< BR > " );

        }



    在这D代码中QToolPane tp = this.ParentToolPane是得到ToolPart所在的ToolPaneQ然后通过ToolPane.SelectedWebPart得到当前的WebPartQ然后通过WebPart.Text得到我们的那个隐藏|q个隐藏值就是文本框的初始倹{这个inputname的变量是做ؓ文本框的name。是在这个ToolPartcM声明的,如下Q?

    string inputname = null;

    然后通过构造函数捕捉初始化事gQ?/font>


public  CustPropsToolPart()
        
{
            
this .Title  =   " 自定义属性的ToolPart "
;
            
this .Init  +=   new
 EventHandler(CustPropsToolPart_Init);
        }

private   void  CustPropsToolPart_Init( object
 sender, EventArgs e)
        
{
            
// 讄定义义属性的文本框的name

             this .inputname  =   this .UniqueID  +   " msg "
;
        }



    在初始化函数中设|inputname的|q个值只要是一个唯一的就可以了,所以借助了UniqueID?

    q是呈现Q那么如何在用户填写了以后保存v来这个值呢Q也即保存到我们WebPart中那个隐藏的Text属性中。这p通过ToolPartcM的ApplyChanges()ҎQ这是点M定认了修改的时候执行的Ҏ。代码如下:

    

public   override   void  ApplyChanges()
        
{
            
//
 Apply property values here.
            
// 得到WebPart对象

            ToolPane tp  =   this
.ParentToolPane;
            CustomProps myWP 
=
 (CustomProps)tp.SelectedWebPart;

            
// 我们自定义的g回到WebPart的Text属性中?/span>

            myWP.Text  =
 Page.Request.Form[inputname];
        }



    通过q段代码我们可以看到Q采用Page.Request.Form[inputname]得到输入在文本框中的|然后赋值给隐藏域?

    q种自定义属性有什么好处呢Q在于你可以控制ToolPart的输出,比如你可以做一些特D的控g让用h便的输入属性等。或者你可以更改文本框的背景色或者前景色Q也即你自己控制的力度加大了?/font>

摘自h工作室( http://sps.oceanstudio.net Q?



2006-11-28 00:36 发表评论
]]>
SPS中禁止sessionQ?/title><link>http://www.aygfsteel.com/zengke/articles/79507.html</link><dc:creator>曄</dc:creator><author>曄</author><pubDate>Tue, 07 Nov 2006 00:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/zengke/articles/79507.html</guid><wfw:comment>http://www.aygfsteel.com/zengke/comments/79507.html</wfw:comment><comments>http://www.aygfsteel.com/zengke/articles/79507.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zengke/comments/commentRss/79507.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zengke/services/trackbacks/79507.html</trackback:ping><description><![CDATA[ <p> <font size="2">我利用sps中的|页查看器功能,加蝲了一个用vs.net开攄webE序?br />但在使用q程中发玎ͼ用到session的地斚w会出现问题,q是Z么?</font> </p> <p> <br /> <font size="2">只有在配|文件或 Page 指o中将启用会话状态设|ؓ真时Q才可以使用会话状?</font> </p> <p> <font size="2">N说在sps中不能用sessionQ?br />=================================================================</font> </p> <p> <font size="2">以上问题是一位网友遇到的问题Q也是我q几天刚遇到的,l过地毯式的排查Q发现问题出在SPSq里</font> </p> <p> <font size="2">1?br />C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS目录里的 web.config文g里缺一句话Q?lt;add name=”Session?type=”System.Web.SessionState.SessionStateModule?></font> </p> <p> <font size="2">加在<httpModules>里,加完之后?lt;httpModules>应该是这L:<br />    <httpModules><br />      <clear /><br />      <add name=”OutputCache?type=”System.Web.Caching.OutputCacheModule?/><br />      <add name=”WindowsAuthentication?type=”System.Web.Security.WindowsAuthenticationModule?/><br />       <add name=”Session?type=”System.Web.SessionState.SessionStateModule?><br />    </httpModules></font> </p> <p> <font size="2">2、在SPS门户所在IIS发布目录里,扑ֈweb.config Q修改Pages里的enableSessionState 为true Q修改后应该是这LQ?br /><pages enableSessionState=”true?enableViewState=”true?enableViewStateMac=”true?validateRequest=”false?/></font> </p> <img src ="http://www.aygfsteel.com/zengke/aggbug/79507.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zengke/" target="_blank">曄</a> 2006-11-07 08:36 <a href="http://www.aygfsteel.com/zengke/articles/79507.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何获取WSS列表视图的中文字D?/title><link>http://www.aygfsteel.com/zengke/articles/77995.html</link><dc:creator>曄</dc:creator><author>曄</author><pubDate>Mon, 30 Oct 2006 02:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/zengke/articles/77995.html</guid><wfw:comment>http://www.aygfsteel.com/zengke/comments/77995.html</wfw:comment><comments>http://www.aygfsteel.com/zengke/articles/77995.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zengke/comments/commentRss/77995.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zengke/services/trackbacks/77995.html</trackback:ping><description><![CDATA[ <p> <font color="#000000" size="2">ViewFields是SPViewFieldCollection, 只能拿到interal nameQ要获取中文的字D名Q可以事先做一个internalName到title的{? </font> </p> <p> <font color="#000000" size="2">using System.collection;</font> </p> <p> <font color="#000000" size="2">SPSite site = new SPSite("url");</font> </p> <p> <font color="#000000" size="2">SPWeb web = site.OpenWeb();</font> </p> <p> <font color="#000000" size="2">SPList list = web.Lists[listname];</font> </p> <p> <font color="#000000" size="2">SPView listview = onelist.Views[view];</font> </p> <p> <font color="#000000" size="2">Hashtable internalToTitle = new Hashtable(); </font> </p> <p> <font color="#000000" size="2">foreach(SPField field in list.Fields) <br />{ <br />internalToTitle.Add(field.InternalName, field.Title); <br />} </font> </p> <p> <font color="#000000" size="2">输出的时候{换一?<br />forQint j=0;j<listview.ViewFieldsQ?br />{<br />output.write(internalToTitle[view.ViewFields[j]].ToString());<br />}</font> <a href="/zengke"> </a> </p> <img src ="http://www.aygfsteel.com/zengke/aggbug/77995.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zengke/" target="_blank">曄</a> 2006-10-30 10:32 <a href="http://www.aygfsteel.com/zengke/articles/77995.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">α</a>| <a href="http://" target="_blank">ͼ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̶</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ľ</a>| <a href="http://" target="_blank">ǭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˴</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɫ</a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ׯ</a>| <a href="http://" target="_blank">տ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Զ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʤ</a>| <a href="http://" target="_blank">ͨ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">̨</a>| <a href="http://" target="_blank">ͩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ƽ</a>| <a href="http://" target="_blank">ʡ</a>| <a href="http://" target="_blank">Ҷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>