Hi Dave, Thanks for the explaination. :) I did try it without the domain but it still gave me the same 403 error. I'm quite puzzled, this should work. Could it be something wrong with my server? I can upload files through an ftp program, is there a way to upload a file through ftp within the 1.1 framework? ~D~
Darshon
Posts
-
Uploading file problem [modified] -
Uploading file problem [modified]Hi everyone, I'm trying to upload an *.xml file to my server and this is the code I'm using. The problem I have is that I get a 403 error every time, even though my folder permissions are correct and my authentications are correct as well. Just wondering if I'm doing something wrong with my code.
If File.Exists("C:\Documents and Settings\Denis\Desktop\GetFileTest\test.xml") Then
Dim remoteUri As String = "http://www.site.com/folder/"
Dim fileName As String = "C:\Documents and Settings\Denis\Desktop\GetFileTest\test.xml"
' Create a new WebClient instance.
Dim myWebClient As New WebClient
myWebClient.Credentials = New NetworkCredential("username", "password", "http://www.site.com/")
Try
' The UploadFile() method uploads the current file to the Web resource-system folder.
myWebClient.UploadFile(remoteUri, fileName)
Label.Text = "Done!"
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Else
Label.Text = "No Go!"
End IfThanks for any help ~D~
modified on Friday, February 22, 2008 11:33 AM
-
Programically Changing the Color Depth of the monitorHi, I'm trying to change the color depth of the user's monitor upon my app starting. I can't seem to find anything on the subject. I'm coding in 1.1 VB.Net framework. Any help would be great. Thanks
-
Close a form from another form?Well I tried these suggestions and all I kept getting is that there was no instance set to an object and I've tried it many different ways and nothing BUT, I did find this article about Singletons which is letting me do exactly what I want. :) So for anyone that is having toubles like this here a good place to start looking >> http://www.codeproject.com/vb/net/Simple_Singleton_Forms.asp[^]
-
Close a form from another form?Thanks guys, I'll try all of them cause I will need to exit certain forms only and also eventually the aplication in the end. Got two answers for the $0.00 price of one. ;)
-
Close a form from another form?Hello everyone, I have two windows forms, form1 has a close button that I would like to use to close not only form1 but also form2 at the same time if form2 is open. Is there a way to do this cause I cannot find anything that can help me with this?
-
How does the AxWebBrowser control know...Well I feel kind of silly because just a few hours after I posted this question I found the answer I was looking for and again with the information I found on this site I was able to do what my users wanted. :-O But in my defence I did look around for many hours before asking! :) Let me take the time though to say that this site and the people coming to it to help absolutely ROCK! I have not found any other site on the internet that helps those in need as much as this one does. Keep up the wonderful work people. :-D
-
How does the AxWebBrowser control know...... when and which Right, Left or Wheel mouse buttons have been used? I'm asking because the control does recongnizes those first three buttons but not the XButton1 and 2 that are used by many as Back and Forward buttons. I would like to get those two working as well, since it is a request from some using my browser. Thanks for any help. -- modified at 17:26 Saturday 18th March, 2006
-
Quarry a MySql DB from a windows Form?(By the way, a quarry[^] is a hole in the ground... ) LOL! :laugh: Thanx, well I was lost there for a while in the dark. ;P
-
Quarry a MySql DB from a windows Form?Is there a way to do this using VB.net? Without going through ASP I would like to directly quarry the db from my form.
-
Need AdviceI'm done with my browser and things are working very nicely, thanks to a lot of advice from the people here. :) My next project is a chat system but I'm not sure which approach would be best to take. I want to making the main application, that will nest all these other projects of mine (Browser, chat, ect), as peer-to-peer as possible in order to avoid as much server usage. I know that it will be unavoidable in certain cases but it is my ultimate goal. I've seen many examples on this site on chat systems but I'm not quite sure as to which is best. Any suggestions as to which type of system/approach would be best for this chat project of mine? Any thoughts would be greatly appreciated. Thanx :) -- modified at 19:46 Tuesday 7th March, 2006
-
AxWebBrowser without form supportHi Dave, You just beat me to it. lol Abu this is one of the very generous people that helped me with mine, I'd listen to him. ;)
-
AxWebBrowser without form supportHi Abu, The problem I see is that you are not adding the AxWebBrowser control to anything first before trying to use it. As far as I know you have to add it to a form, TabPage, Panel or GroupdBox or something like that. You can't just tell it to appear and start using it, it must be put on something of that nature first in order to use it. But I could be wrong, I'm new at this although I just finished working with the AxWebBrowser control to do a Web Browser myself.
-
Might be a stupid question but...Hey Dean, I got it to work! :-) Sorry but the Newbie is excited!!! lol I figured it out. I was reading the text wrong. I was reading the whole thing in one shot instead of reading it line by line and the 4th line I had to read it in two shots. This is the reading code I did and it all works just fine now. For anyone (Newbies) that need to know how to do this here's the extra code to finish it up. Change everything between the "Dim url As String" and the beginning of the listview code to this below.
'Read the url file and get the url text Dim c(3) As Char Dim url As String url = sr.ReadLine() url = sr.ReadLine() url = sr.ReadLine() url = sr.Read(c, 0, c.Length) url = sr.ReadLine()
Thanks again for all of your help Dean. :-) -
Might be a stupid question but...Hey Dean, I did what you suggested and it works very nicely and it doesn't lag at all. At least not with my Favorites folder and I have quite a few links in there. ;-) The only problem I have now is that I have only been able to read the complete url file text and there is too much garbage text to send it as a http: address. I have to find a way to extract only the url text and put that in the hidden column. Any ideas? Thanks :-) The text I get from the StreamReader is simular to this for every url file it reads, just the actual http:// text changes. "[default]baseurl=http://www.adenak.com/\[InternetShortcut\]URL=http://www.adenak.com/Modified=1067F49A2E3BC50134"
Private Sub tvwExplorer_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwExplorer.AfterSelect 'Get reference to the selected node Dim dirInfo As DirectoryInfo = New DirectoryInfo(e.Node.FullPath) 'Clear all the items in the listview lvwExplorer.Items.Clear() 'Check if the Directory exist or not If (dirInfo.Exists) Then 'Get reference to all the files Dim fileInfos As FileInfo() = dirInfo.GetFiles() 'Add all the files to the ListView one by one Dim info As FileInfo For Each info In fileInfos 'First check the extension, make sure it's a url file If info.Extension = ".url" Then Try 'Open the file and read it 'Convert the file path into a string for the StreamReader Dim infoPath As String = info.FullName ' Create an instance of StreamReader to read from each file. Dim sr As StreamReader = New StreamReader(infoPath) 'Read the complete url file text Dim url As String url = sr.ReadToEnd() 'Extract only the url text **This is where I need to extract the http text** Dim item As ListViewItem = New ListViewItem item = lvwExplorer.Items.Add(info.Name) ' Link the ImageList object item.ImageIndex = 2 'Add the items item.SubItems.Add(url.ToString()) item.SubItems.Add(info.LastAccessTime.ToString()
-
Might be a stupid question but...so each file in the directory I look through to populate the ListView I would need to open/read it and then put it's http address text in a hidden column in the Listview. That's what you mean right? Question: If so, wouldn't that make things lag quite a bit if a person has many folders with possible 100's of links in it? Thanks -- modified at 17:56 Friday 24th February, 2006
-
Might be a stupid question but...It gets the name of the url files like this. 1sitename.url 2sitename.url
-
Might be a stupid question but...Hello Dean, Thank you for that code. :-) It does work except it gives me the text of the item name as the navigating address which does not work. You have helped me though to realize that I must find a way to open the url file referrenced by that ListItem name in order to read it and then send the "http://" text within that file to the WebBrowser.Navigate. If you or anyone else can help me out to do this or maybe direct me in the right dirrection to figure it out, that would be great. Thanks again for your help.
-
Might be a stupid question but...I just can't seem to wrap my brain around this one. (Yes I'm a Newbei, lol) I just don't understand how to click on a list item and get it to do what I want. I've got a listview control that shows "*.url" files and I'd like the user to click on the list item (*.url) and get it to open in the WebBrowser control that's on the same form. How would I go about doing that. I'm using VS.Net 2003.
-
What am I missing here?Nevermind! :-) I got it to work. I downloaded an example project from this site and looked at how s/he assigned an imagelist to an listviewitem and I got it to work on mine. Thanks for your help.