Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VB 2008 - Useful Code
#11
Hello, I'm new at programming with VB .net. When i tried to make an emailer plus file attacher i am getting errors at this line
Code:
If My.Computer.FileSystem.FileExists(attachedFile) Then message.Attachments.Add(attach)
If i am making with path textbox and if i dont write textbox name in "attachedFile" slot i get error cause it's not defined, BUT if i write correct name i get an error at
Code:
message.Attachments.Add(attach)
It says "Variable 'attach' is used before it has been assigned value. A null reference could result exception at a runtime." any help? Thank you in advance
Reply
#12
very nice sources
Reply
#13
That first one is sweet, nice guide.
Reply
#14
(05-01-2010, 07:45 AM)macas5 Wrote: Hello, I'm new at programming with VB .net. When i tried to make an emailer plus file attacher i am getting errors at this line
Code:
If My.Computer.FileSystem.FileExists(attachedFile) Then message.Attachments.Add(attach)
If i am making with path textbox and if i dont write textbox name in "attachedFile" slot i get error cause it's not defined, BUT if i write correct name i get an error at
Code:
message.Attachments.Add(attach)
It says "Variable 'attach' is used before it has been assigned value. A null reference could result exception at a runtime." any help? Thank you in advance

What happens when you run the program? Unless you forgot to add,
Code:
Dim attach As System.Net.Mail.Attachment
Then I think it should work fine..
Reply
#15
Thanks for the code :p

(05-13-2010, 01:37 AM)Dubstep Wrote: What happens when you run the program? Unless you forgot to add,
Code:
Dim attach As System.Net.Mail.Attachment
Then I think it should work fine..

This should work, good luck.
Reply
#16
Very useful for beginners, thanks for the share.
This will come in handy for sure.
Reply
#17
This is a nice list of codes. Thanks.
Reply
#18
Thanks for the code dude I will test it.
Reply
#19
Thanks man. I'm learning VB.Net and this was pretty cool Smile
[Image: ojntld.png]
  • MSN: xAnonymous420@Hotmail.com
Reply
#20
Nicely Done.. Good Job
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get Country Code In 1 Line Of Code. wchar_t 13 4,642 11-28-2012, 06:49 AM
Last Post: Cubs
  [Pandora Incorporated] Visual Basic 2008 - Source Code Grabber [VIDEO TUTORIAL] Marik™ 13 4,666 05-23-2011, 06:41 PM
Last Post: KoBE
  [Pandora Incorporated]Visual Basic 2008 -MD5 Encryptor [VIDEO TUTORIAL] Marik™ 2 1,658 05-13-2011, 11:06 AM
Last Post: Imports System.Net
  [Pandora Incorporated] Visual Basic 2008 - Text To Speech [VIDEO TUTORIAL] Marik™ 1 1,572 04-14-2011, 05:37 PM
Last Post: Emily
  [Help] [VB.NET 2008] Textbox Contents Encryption. Example 4 4,001 02-23-2011, 01:16 AM
Last Post: Example

Forum Jump:


Users browsing this thread: 2 Guest(s)