Try Dim MyCredentials = New NetworkCredential("username", "password")
or Dim MyCredentials As NetworkCredential = New NetworkCredential("username", "password")
.
vb compile error

Ronald Chandler
41
Reputation points
I am using Visual Studio Express 2013 and Visual Basic., Windows 10. The statement:
NetworkCredential MyCredentials = New NetworkCredential("username", "password")
will not compile. Error is "NetworkCredential is a type and cannot be used as an expression"
My imports are:
Imports System.Net.Mail
Imports System.Net.Mime
Imports System.Net
What am I missing?
1 answer
Sort by: Most helpful
-
Viorel 95,071 Reputation points
2022-11-18T20:48:33.32+00:00