Jump to content
Xtreme .Net Talk

gorbit

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by gorbit

  1. It didn't work, mate. I got rid of "fileIO" and just used "stm" as an io.stream an i still got the same result. can't run the file. i know the problem's not with the server either - it'll work if i use internet explorer to download it. the file on the server and the one downloaded using the sub are exactly the same size and even when i open the two in notepad, i see the same gibberish in each. i have no idea what is going on. here's the new sub Public Sub GetFile(ByVal uri As String, ByVal toFile As String) Dim wreq As Net.HttpWebRequest = Net.WebRequest.CreateDefault(New Uri(v_base & uri)) wreq.AllowAutoRedirect = True wreq.Proxy = Net.WebProxy.GetDefaultProxy Dim resI As Net.HttpWebResponse = wreq.GetResponse Dim stm As IO.Stream = resI.GetResponseStream Dim buff(resI.ContentLength - 1) As Byte stm.Read(buff, 0, buff.Length) stm.Close() stm = IO.File.Open(toFile, IO.FileMode.Create) stm.Write(buff, 0, buff.Length) stm.Close() resI.Close() End Sub
  2. I'm writing a sub in one of my VB programs for downloading .exe files from an HTTP server to the local machine. But when ever the file is downloaded it appears to be corrupted because no icon shows on the file and it wont run. The same code works fine for ordinary HTML pages but not exes it seems. Can anyone help with this problem? - here's the sub: Dim v_base As String = "http://www.talbotech.com/" Public Sub GetFile(ByVal uri As String, ByVal toFile As String) Dim wreq As Net.HttpWebRequest = Net.WebRequest.CreateDefault(New Uri(v_base & uri)) wreq.AllowAutoRedirect = True wreq.Proxy = Net.WebProxy.GetDefaultProxy Dim resI As Net.HttpWebResponse = wreq.GetResponse Dim wres As IO.StreamReader = New IO.StreamReader(resI.GetResponseStream, System.Text.Encoding.Default) Dim buff(resI.ContentLength - 1) As Char wres.Read(buff, 0, buff.Length) Dim fileIO As IO.StreamWriter = New IO.StreamWriter(IO.File.Open(toFile, IO.FileMode.Create), System.Text.Encoding.Default) fileIO.Write(buff, 0, buff.Length) fileIO.Close() wres.Close() resI.Close() End Sub
  3. I am currently writing a program in VB .NET that requires a file type - .fol - to be associated with it so that people can simply double click on the .fol file to get my program. My problem is that i want a seperate icon for the .fol file other than the one my assembly has. What i want is to be able to somehow put more than one icon into the assembly - other than the assembies icon - and link the default icon for the .fol file type with the second or third icon in my assembly, so that i don't have to include a seperate icon file with the assembly. Like the way Dreamweaver has it's icons all its main assembly: http://www.talbotech.com/drmIcons.jpg I have tried many techniques so far such as using IconForge to make a .icl file and try to set that as the default icon, and importing the icons into my project as Embedded Resources. But my efforts so far have failed :( : http://www.talbotech.com/bindIcons.jpg I was hoping that someone might know. Please reply as soon as possible. This is driving me mad! :mad:
  4. i need a way to do it without using any plug-ins or anything like that. i read that there's some way to do it without using EnableVisualStyles and using a manifest instead. only problem is that i haven't the faintest idea what a manifest is, or how to make one! any help?
  5. I have the same problem I'm writing a program at the moment, and it does the exact same thing. Do you use Application.EnableVisualStyles?
×
×
  • Create New...