Domanda

Sto usando WSS 2.0 con SharePoint Portal Server 2003. Sto effettuando l'applicazione Web in VS 2008 che apre il sito di SharePoint creato in Portal Server.

Quando passerò l'indirizzo del sito a Spsite mi dà un errore. "Stringa di input non in formato corretto"

Ecco il mio codice

string site_Str= "http://<serverName>:<PortNumber>/sites/<TopLevelSite>";
SPSite site=new SPSite(site_Str); // here it gives error

ed ecco lo stack traccia

"   at Microsoft.SharePoint.i.a(Boolean A_0, String A_1, Guid A_2, Int32& A_3)\r\n   at Microsoft.SharePoint.SPSite.j()\r\n   at Microsoft.SharePoint.SPSite.a(String A_0, SPVirtualServer A_1, a A_2, Int32 A_3)\r\n   at Microsoft.SharePoint.SPSite..ctor(String strUrl)\r\n   at testRoundLink._Default.GetJavaScript() in E:\\resarch\\testRoundLink\\testRoundLink\\Default.aspx.cs:line 46\r\n   at testRoundLink._Default.Page_Load(Object sender, EventArgs e) in E:\\resarch\\testRoundLink\\testRoundLink\\Default.aspx.cs:line 19\r\n   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n   at System.Web.UI.Control.OnLoad(EventArgs e)\r\n   at System.Web.UI.Control.LoadRecursive()\r\n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

Come posso risolverlo.

Grazie in anticipo

È stato utile?

Soluzione

prova questo:

string site_Str= "http://<serverName>:<PortNumber>";
SPSite site=new SPSite(site_Str); 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top