Click here to Skip to main content
15,889,200 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Import Outlook calendar entries from Excel with VBscript? Pin
Richard Deeming1-Sep-17 2:47
mveRichard Deeming1-Sep-17 2:47 
GeneralRe: Import Outlook calendar entries from Excel with VBscript? Pin
xs13x1-Sep-17 3:13
xs13x1-Sep-17 3:13 
GeneralRe: Import Outlook calendar entries from Excel with VBscript? Pin
Richard Deeming1-Sep-17 4:00
mveRichard Deeming1-Sep-17 4:00 
QuestionI need to load a JP2 into an ImageList. All info I've found is out of date. Pin
Member 1338764431-Aug-17 5:19
Member 1338764431-Aug-17 5:19 
QuestionMessage Removed Pin
30-Aug-17 17:49
compcanada201730-Aug-17 17:49 
QuestionOpenFileDialog - Specific Path Pin
purushotham.k929-Aug-17 6:00
purushotham.k929-Aug-17 6:00 
AnswerRe: OpenFileDialog - Specific Path Pin
A_Griffin29-Aug-17 8:07
A_Griffin29-Aug-17 8:07 
QuestionUsing Webclient.uploadfile files is never copied to website Pin
Member 1098357222-Aug-17 12:47
Member 1098357222-Aug-17 12:47 
<pre lang="text">I am using WebClient.UploadFile to upload local files to a Hostmonster web server. I have code that downloads files from my website correctly but I am new to uploading. If doesn't seem very difficult but I just can't get it to work. I have basically copied the vb.net code from https://msdn.microsoft.com/en-us/library/36s52zhs(v=vs.110).aspx. I am using server side code located in the same folder that the file is being transferred to, referred to as Upload.net and listed below.

<%@ Import Namespace="System"%>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Net"%>
<%@ Import NameSpace="System.Web"%>

<Script language="VB" runat=server>
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

Dim f As String
Dim file
For Each f In Request.Files.AllKeys
file = Request.Files(f)
file.SaveAs(Server.MapPath("~/data/" & file.FileName)
Next f

End Sub

</Script>
<html>
<body>
<p> Upload complete. </p>
</body>
</html>


Function TestWcWrite()
Dim LoginUser As String = "testuser"
Dim UserPassword As String = "testpass"
Dim UrlLicensePath As String = "http://www.xxx.com/data/"

Using wc As New System.Net.WebClient()
ServicePointManager.ServerCertificateValidationCallback =
New System.Net.Security.RemoteCertificateValidationCallback(AddressOf CertificateValidation)
wc.Credentials = New System.Net.NetworkCredential(LoginUser, UserPassword)
Dim responseArray As Byte() = wc.UploadFile(UrlLicensePath & "upload.net", "POST", "C:\temp\test.txt")
Console.WriteLine(ControlChars.Cr & "Response Received.The contents of the file uploaded are: " &
ControlChars.Cr & "{0}", System.Text.Encoding.ASCII.GetString(responseArray))
wc.Dispose()
End Using
End Function

The folder I am loading to is password protected and the permissions are set to 777 at this point. I was using Https originally so that is why the RemoteCertificateValidationCallback is in the code. Anyway when I execute the code, the file isn't copied and the response returned is the contents of upload.net file. What am I missing here? Obviously it is something minor.

Thanks for your help,
Bob
Questionvb.net desktop app zoom feature Pin
dcof22-Aug-17 6:34
dcof22-Aug-17 6:34 
AnswerRe: vb.net desktop app zoom feature Pin
Eddy Vluggen22-Aug-17 8:15
professionalEddy Vluggen22-Aug-17 8:15 
GeneralRe: vb.net desktop app zoom feature Pin
dcof23-Aug-17 8:49
dcof23-Aug-17 8:49 
GeneralRe: vb.net desktop app zoom feature Pin
Eddy Vluggen23-Aug-17 9:57
professionalEddy Vluggen23-Aug-17 9:57 
SuggestionRe: vb.net desktop app zoom feature Pin
Richard MacCutchan23-Aug-17 21:17
mveRichard MacCutchan23-Aug-17 21:17 
QuestionHow to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha20-Aug-17 22:15
hmanhha20-Aug-17 22:15 
AnswerRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Richard MacCutchan21-Aug-17 0:39
mveRichard MacCutchan21-Aug-17 0:39 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha21-Aug-17 15:49
hmanhha21-Aug-17 15:49 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Mycroft Holmes21-Aug-17 19:59
professionalMycroft Holmes21-Aug-17 19:59 
QuestionMapWinGIS and Visual Basic Pin
Member 1336786618-Aug-17 15:20
Member 1336786618-Aug-17 15:20 
QuestionTrying to connect to SAP Pin
A_Griffin18-Aug-17 5:15
A_Griffin18-Aug-17 5:15 
AnswerRe: Trying to connect to SAP Pin
Dave Kreskowiak18-Aug-17 7:18
mveDave Kreskowiak18-Aug-17 7:18 
GeneralRe: Trying to connect to SAP Pin
A_Griffin18-Aug-17 8:08
A_Griffin18-Aug-17 8:08 
GeneralRe: Trying to connect to SAP Pin
Richard Deeming18-Aug-17 8:18
mveRichard Deeming18-Aug-17 8:18 
GeneralRe: Trying to connect to SAP Pin
A_Griffin18-Aug-17 8:31
A_Griffin18-Aug-17 8:31 
GeneralRe: Trying to connect to SAP Pin
Dave Kreskowiak20-Aug-17 7:38
mveDave Kreskowiak20-Aug-17 7:38 
GeneralRe: Trying to connect to SAP Pin
A_Griffin20-Aug-17 8:45
A_Griffin20-Aug-17 8:45 

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.