v-wdxu
Sat Feb 14 03:24:30 CST 2004
------=_NextPart_0001_68CB679C
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi Dan,
Thanks for posting in the community!
From my understanding to this issue, you are going to use the search
function of WSS site in one web part.
I'd suggest you can use the methods "SearchDocuments" and "SearchListItems"
to search the documents or list data in the specified web site for the
specified string. I write one sample code for you.
//Code begin ---------------------------------------------------------
//I am researching the rootweb
try
{
SPSite siteCollection = new SPSite("
http://<the url>");
SPWeb oRootSite = siteCollection.RootWeb;
SPSearchResultCollection oSRSet = oRootSite.SearchDocuments("<specified
search string>");
foreach( SPSearchResult oSR in oSRSet )
{
//you can test this code from one console applicatoin
first
//then create one web part with the codes
Console.WriteLine(oSR.Title);
}
}
catch( Exception exp )
{
Console.WriteLine( exp.Message );
}
//Code end ---------------------------------------------------------
Please feel free to let me know if you have any further questions.
Have a nice weekend!
Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_68CB679C
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Dan,
\par
\par Thanks for posting in the community!
\par
\par From my understanding to this issue, you are going to use the search function of WSS site in one web part.
\par
\par I'd suggest you can use the methods "SearchDocuments" and "SearchListItems" to search the documents or list data in the specified web site for the specified string. I write one sample code for you.
\par //Code begin ---------------------------------------------------------
\par //I am researching the rootweb
\par try
\par \{
\par SPSite siteCollection = new SPSite("
http://<the url>");
\par \tab SPWeb oRootSite = siteCollection.RootWeb;
\par
\par \tab SPSearchResultCollection oSRSet = oRootSite.SearchDocuments("<specified search string>");
\par \tab foreach( SPSearchResult oSR in oSRSet )
\par \tab\{
\par //you can test this code from one console applicatoin first
\par //then create one web part with the codes
\par \tab\tab Console.WriteLine(oSR.Title);
\par \tab\}
\par \}
\par catch( Exception exp )
\par \{
\par \tab Console.WriteLine( exp.Message );
\par \}
\par //Code end ---------------------------------------------------------
\par
\par Please feel free to let me know if you have any further questions.
\par
\par Have a nice weekend!
\par
\par Wei-Dong Xu
\par Microsoft Product Support Services
\par Get Secure! - www.microsoft.com/security
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par }
------=_NextPart_0001_68CB679C--