Click here to Skip to main content
15,559,567 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB, Linq, Filter out List(Of with a list(Of string [solved] Pin
jkirkerx16-Feb-21 12:47
professionaljkirkerx16-Feb-21 12:47 
SuggestionRe: VB, Linq, Filter out List(Of with a list(Of string [solved] Pin
Richard Deeming16-Feb-21 23:18
mveRichard Deeming16-Feb-21 23:18 
GeneralRe: VB, Linq, Filter out List(Of with a list(Of string [solved] Pin
jkirkerx17-Feb-21 5:46
professionaljkirkerx17-Feb-21 5:46 
QuestionConvert C to VB Pin
leofoe15-Feb-21 23:52
leofoe15-Feb-21 23:52 
AnswerRe: Convert C to VB Pin
Richard Deeming16-Feb-21 0:38
mveRichard Deeming16-Feb-21 0:38 
GeneralRe: Convert C to VB Pin
leofoe16-Feb-21 0:46
leofoe16-Feb-21 0:46 
GeneralRe: Convert C to VB Pin
Richard Deeming16-Feb-21 2:19
mveRichard Deeming16-Feb-21 2:19 
QuestionDeleting a sent file Pin
Member 1152288212-Feb-21 12:11
Member 1152288212-Feb-21 12:11 
Hello, how do I delete a file from my computer that has already been sent to an email?

VB.NET
Imports System.IO
Imports System.Net.Mail

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim compInfo = "computerInfo.txt"
Try
Dim MailMessage As New MailMessage()
MailMessage.From = New MailAddress("@gmail.com")
MailMessage.To.Add("@gmail.com")
MailMessage.Attachments.Add(New System.Net.Mail.Attachment(compInfo))
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 587
SMTPServer.Credentials = New System.Net.NetworkCredential("@gmail.com", "pass")
SMTPServer.EnableSsl = True
Catch
End Try

If System.IO.File.Exists(compInfo) = True Then
System.IO.File.Delete(compInfo)
End If

End Sub


The problem appears in:
VB
System.IO.File.Delete(compInfo)


"The process cannot access the C:\...\...\computerInfo.txt file because it is being used by another process"
AnswerRe: Deleting a sent file Pin
Ralf Meier12-Feb-21 13:26
mveRalf Meier12-Feb-21 13:26 
AnswerRe: Deleting a sent file Pin
Dave Kreskowiak12-Feb-21 16:51
mveDave Kreskowiak12-Feb-21 16:51 
AnswerRe: Deleting a sent file Pin
Richard Deeming14-Feb-21 22:51
mveRichard Deeming14-Feb-21 22:51 
Questionwkhtmltopdf.exe - Process-Start over COM-Interop - Access denied Pin
VoidFunctionMain10-Feb-21 5:48
VoidFunctionMain10-Feb-21 5:48 
QuestionCode for Saving work Pin
Wamono erick5-Feb-21 8:52
Wamono erick5-Feb-21 8:52 
AnswerRe: Code for Saving work Pin
Dave Kreskowiak5-Feb-21 9:28
mveDave Kreskowiak5-Feb-21 9:28 
QuestionProblem when setting the ReadOnly state of a property: CLOSED Pin
mo149231-Jan-21 6:56
mo149231-Jan-21 6:56 
QuestionInterfacing with Zlib.dll Pin
albert_redditt28-Jan-21 11:16
albert_redditt28-Jan-21 11:16 
AnswerRe: Interfacing with Zlib.dll Pin
20212a28-Jan-21 11:30
20212a28-Jan-21 11:30 
AnswerRe: Interfacing with Zlib.dll Pin
Richard MacCutchan28-Jan-21 22:14
mveRichard MacCutchan28-Jan-21 22:14 
QuestionUnable to complete the code for Web scrapping Pin
The Mentee27-Jan-21 9:56
The Mentee27-Jan-21 9:56 
AnswerRe: Unable to complete the code for Web scrapping Pin
Richard Deeming27-Jan-21 22:49
mveRichard Deeming27-Jan-21 22:49 
GeneralRe: Unable to complete the code for Web scrapping Pin
The Mentee28-Jan-21 1:06
The Mentee28-Jan-21 1:06 
GeneralRe: Unable to complete the code for Web scrapping Pin
DerekT-P28-Jan-21 8:07
professionalDerekT-P28-Jan-21 8:07 
GeneralPersonal Appointment Reminder Code Pin
mike Pant10-Jan-21 3:58
mike Pant10-Jan-21 3:58 
GeneralRe: Personal Appointment Reminder Code Pin
Victor Nijegorodov10-Jan-21 4:59
Victor Nijegorodov10-Jan-21 4:59 
GeneralRe: Personal Appointment Reminder Code Pin
Gerry Schmitz10-Jan-21 5:47
mveGerry Schmitz10-Jan-21 5:47 

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.