Click here to Skip to main content
15,926,507 members
Home / Discussions / C#
   

C#

 
AnswerRe: DataGrid control WinFroms Pin
Paul Conrad8-Sep-07 4:27
professionalPaul Conrad8-Sep-07 4:27 
QuestionRythm game Pin
pokabot8-Sep-07 3:08
pokabot8-Sep-07 3:08 
AnswerRe: Rythm game Pin
Guffa8-Sep-07 3:56
Guffa8-Sep-07 3:56 
GeneralRe: Rythm game Pin
pokabot8-Sep-07 4:35
pokabot8-Sep-07 4:35 
QuestionArray Pin
edwinlazer8-Sep-07 2:35
edwinlazer8-Sep-07 2:35 
AnswerRe: Array Pin
Guffa8-Sep-07 2:46
Guffa8-Sep-07 2:46 
GeneralRe: Array Pin
edwinlazer9-Sep-07 19:28
edwinlazer9-Sep-07 19:28 
QuestionSharepoint server URL [modified] Pin
Ramamurthi8-Sep-07 2:10
Ramamurthi8-Sep-07 2:10 
Hi All,

I am facing two problems while accessing the Sharepoint server URL using HttpWebRequest/HttpWebResponse.

Sample Code:

try
{
string Url = "http://<sharepoint server>/<site>/<docment library>;
Uri destUri = new Uri(Url);
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(destUri);

CredentialCache cache = new CredentialCache();
cache.Add(req.RequestUri, "Negotiate", new NetworkCredential(strUserName, strPassword, strDomain));
cache.Add(req.RequestUri, "NTLM", new NetworkCredential(strUserName, strPassword, strDomain));
req.Credentials = cache;

HttpWebResponse ores = (HttpWebResponse)req.GetResponse();
ores.Close();
if(ores.StatusDescription.ToLower() == "ok")
{
MessageBox.Show("Success");
}
else
{
MessageBox.Show(ores.StatusDescription);
}
}
catch (WebException we)
{
MessageBox.Show("Web Exception : " + we.Message);
}
catch (Exception ex)
{
MessageBox.Show("General Exception : " + ex.Message);
}

Issue #1:

I have created the folder inside a folder under sharepoint document library(ex: DocumentLibrary\Folder1\Folder2)

Using the above code I am testing the connection, it returns Success up to Folder1(ex: http://<server>/<site>/DocumentLibrary/Folder1)

I am trying the add the Folder2 in URL, It returns web exception UnAuthorized for the same credential.(eg: http://<server>/<site>/DocumentLibrary/Folder1/Folder2)

Issue #2: If there is any space in document library name, it returns web exception "Bad URL"
(eg: http://<server>/<site>/Shared Documents)



Can any one know how to fix these problems?

Thanks
Ram



-- modified at 16:03 Saturday 8th September, 2007
QuestionUnhandled Exception Pin
B!Z8-Sep-07 1:22
B!Z8-Sep-07 1:22 
QuestionI have asked this question many times I'm lost Pin
XFighter8-Sep-07 1:04
XFighter8-Sep-07 1:04 
AnswerRe: I have asked this question many times I'm lost Pin
Skippums10-Sep-07 4:20
Skippums10-Sep-07 4:20 
GeneralRe: I have asked this question many times I'm lost Pin
XFighter10-Sep-07 5:09
XFighter10-Sep-07 5:09 
GeneralRe: I have asked this question many times I'm lost Pin
Skippums10-Sep-07 10:02
Skippums10-Sep-07 10:02 
QuestionOCIEnvCreate failed with return code -1 Error with .NET 2.0 Pin
Muammar©8-Sep-07 0:16
Muammar©8-Sep-07 0:16 
Questionwindows service Pin
rcwoods7-Sep-07 22:45
rcwoods7-Sep-07 22:45 
AnswerRe: windows service Pin
Giorgi Dalakishvili8-Sep-07 1:04
mentorGiorgi Dalakishvili8-Sep-07 1:04 
Questionproblem about set resolution in twain.net scanner Pin
chehreghany7-Sep-07 22:20
chehreghany7-Sep-07 22:20 
AnswerRe: problem about set resolution in twain.net scanner Pin
Dave Kreskowiak8-Sep-07 3:21
mveDave Kreskowiak8-Sep-07 3:21 
QuestionWhat is wrong in this code? Pin
andredani7-Sep-07 20:11
andredani7-Sep-07 20:11 
AnswerRe: What is wrong in this code? Pin
Guffa7-Sep-07 21:55
Guffa7-Sep-07 21:55 
GeneralRe: What is wrong in this code? Pin
andredani8-Sep-07 10:00
andredani8-Sep-07 10:00 
AnswerRe: What is wrong in this code? Pin
Guffa8-Sep-07 11:04
Guffa8-Sep-07 11:04 
GeneralRe: What is wrong in this code? [modified] Pin
andredani8-Sep-07 12:45
andredani8-Sep-07 12:45 
GeneralRe: What is wrong in this code? Pin
Insincere Dave8-Sep-07 14:16
Insincere Dave8-Sep-07 14:16 
GeneralRe: What is wrong in this code? Pin
andredani9-Sep-07 1:03
andredani9-Sep-07 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.