Can anyone tell me what the purpose is to adding items such as a
VBScript file or HTML document to your VB.NET project? Once you have
these things added, how to you access them and use them in your code? 14 1731
* copyco <co****@anon.com> scripsit: Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
What exactly do you want to do with the files?
--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
copyco, Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project?
These files are commonly used in ASP.NET (web projects).
I will use an HTML document in Windows Forms projects to contain
documentation and/or readme files.
Having them in a Windows Forms project is also useful if your Windows Forms
project relies on the Web Browser control for its primary interface...
I'm sure there are other uses for them (read as "think out side the box").
Once you have these things added, how to you access them and use them in your code?
Really depends on why you added them. (web project, documentation, Web
Browser UI, other).
Hope this helps
Jay
"copyco" <co****@anon.com> wrote in message
news:%e******************@newssvr24.news.prodigy.c om... Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
Hi Copyco,
As an addition to Herfried,
You can add everything to a Vb.net project.
movies, pictures, html.documents, xmldatasets.
If you are not intended to use them you can better not do that, it uses only
space.
Just my thought.
Cor Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
Herfried K. Wagner [MVP] wrote: * copyco <co****@anon.com> scripsit:
Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
What exactly do you want to do with the files?
Well, I was thinking I might be able to dynamically edit the html
document and then export it. Or with the VBScript, pass some parameters
to it from my WinForm code and execute it. Is this possible? Or does
the VBScript have to be external to the project?
* copyco <co****@anon.com> scripsit: Well, I was thinking I might be able to dynamically edit the html document and then export it. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible? Or does the VBScript have to be external to the project?
You can add it to the project, but in the output it must still remain a
separate file (not embedded into the application's binary).
--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
This is not new to VS2003. We added .doc files to VB6 project to ensure
that all information about a project was kept as one entity. Using this
allowed these documents to be under source control (better than relying on
people to do it themselves). A get latest version of the project would get
all info. This is the same for any type of file.
Think of it as simply a method to organize the data needed to create an
application. Even if the file is not compiled (as a .doc or .bmp/jpg would
be), those files travel with the project/solution.
Lloyd Sheen
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ee**************@TK2MSFTNGP12.phx.gbl... * copyco <co****@anon.com> scripsit: Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
What exactly do you want to do with the files?
-- Herfried K. Wagner [MVP] <http://dotnet.mvps.org/> Website Address Changed!
copyco, Well, I was thinking I might be able to dynamically edit the html document and then export it.
Explain "export it", HTML added to a project is going to be "external" to
the binary, which means you will need to add it to your setup project to
have it deployed. Alternatively you can set the "Build Action" to "Embedded
Resource" to have the HTML file embedded into your executable, which means
you may then need to "export it" to a file, to actually use it. The Build
Action is available from the properties window when you select the file in
Solution Explorer. You can use a ResourceManager and/or ResourceReader to
get at the embedded file in your executable.
Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible?
You could use either the COM Script control, or Process.Start to exectu
Or does the VBScript have to be external to the project?
You could have the VBScript embedded in the executable like you can an HTML
file.
Hope this helps
Jay
"copyco" <co****@anon.com> wrote in message
news:5h**********************@newssvr11.news.prodi gy.com...
Herfried K. Wagner [MVP] wrote:
* copyco <co****@anon.com> scripsit:
Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
What exactly do you want to do with the files?
Well, I was thinking I might be able to dynamically edit the html document and then export it. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible? Or does the VBScript have to be external to the project?
Hi Copyco,
I think that I start to understand what is the basis of your question
With the VS.studio IDE you can make perfect classic HTML websites.
Therefore you need things as javascript, css, vbscript and of course HTML
files.
Cor
Jay B. Harlow [MVP - Outlook] wrote: copyco,
Well, I was thinking I might be able to dynamically edit the html document and then export it.
Explain "export it", HTML added to a project is going to be "external" to the binary, which means you will need to add it to your setup project to have it deployed. Alternatively you can set the "Build Action" to "Embedded Resource" to have the HTML file embedded into your executable, which means you may then need to "export it" to a file, to actually use it. The Build Action is available from the properties window when you select the file in Solution Explorer. You can use a ResourceManager and/or ResourceReader to get at the embedded file in your executable.
Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible?
You could use either the COM Script control, or Process.Start to exectu
Or does the VBScript have to be external to the project?
You could have the VBScript embedded in the executable like you can an HTML file.
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:5h**********************@newssvr11.news.prodi gy.com...
Herfried K. Wagner [MVP] wrote:
* copyco <co****@anon.com> scripsit:
Can anyone tell me what the purpose is to adding items such as a VBScript file or HTML document to your VB.NET project? Once you have these things added, how to you access them and use them in your code?
What exactly do you want to do with the files?
Well, I was thinking I might be able to dynamically edit the html document and then export it. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible? Or does the VBScript have to be external to the project?
Ok let's say I have a VBScript file embeded in my executable. How would
I write the code that would execute the script?
Copyco, Ok let's say I have a VBScript file embeded in my executable. How would I write the code that would execute the script?
First I would have to question WHY? I would simply convert the VBScript to
VB.NET and execute it either directly or dynamically.
If I had a hard requirement to actually execute VBScript, (First I would
seriously consider changing the requirement, see above) then I would
consider using the ResourceManager to read the embedded VBScript file, write
it to a temp file, then use Process.Start to execute the temp file.
Are you asking for me to give you the code to perform the above steps? A
specific step?
To read the resource I would start here: http://msdn.microsoft.com/library/de...ClassTopic.asp http://msdn.microsoft.com/library/de...ClassTopic.asp
To write the temp file I would start here: http://msdn.microsoft.com/library/de...ClassTopic.asp
To execute the temp file I would start here: http://msdn.microsoft.com/library/de...tartTopic3.asp
Hope this helps
Jay
"copyco" <co****@anon.com> wrote in message
news:6f**********************@newssvr11.news.prodi gy.com...
Jay B. Harlow [MVP - Outlook] wrote:
copyco,
Well, I was thinking I might be able to dynamically edit the html document and then export it.
Explain "export it", HTML added to a project is going to be "external"
to the binary, which means you will need to add it to your setup project to have it deployed. Alternatively you can set the "Build Action" to
"Embedded Resource" to have the HTML file embedded into your executable, which
means you may then need to "export it" to a file, to actually use it. The
Build Action is available from the properties window when you select the file
in Solution Explorer. You can use a ResourceManager and/or ResourceReader
to get at the embedded file in your executable.
Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible?
You could use either the COM Script control, or Process.Start to exectu
Or does the VBScript have to be external to the project?
You could have the VBScript embedded in the executable like you can an
HTML file.
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:5h**********************@newssvr11.news.prodi gy.com...
Herfried K. Wagner [MVP] wrote:
* copyco <co****@anon.com> scripsit:
>Can anyone tell me what the purpose is to adding items such as a >VBScript file or HTML document to your VB.NET project? Once you have >these things added, how to you access them and use them in your code?
What exactly do you want to do with the files? Well, I was thinking I might be able to dynamically edit the html document and then export it. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible? Or does the VBScript have to be external to the project?
Ok let's say I have a VBScript file embeded in my executable. How would I write the code that would execute the script?
Jay B. Harlow [MVP - Outlook] wrote: Copyco,
Ok let's say I have a VBScript file embeded in my executable. How would I write the code that would execute the script?
First I would have to question WHY? I would simply convert the VBScript to VB.NET and execute it either directly or dynamically.
If I had a hard requirement to actually execute VBScript, (First I would seriously consider changing the requirement, see above) then I would consider using the ResourceManager to read the embedded VBScript file, write it to a temp file, then use Process.Start to execute the temp file.
Are you asking for me to give you the code to perform the above steps? A specific step?
To read the resource I would start here: http://msdn.microsoft.com/library/de...ClassTopic.asp
http://msdn.microsoft.com/library/de...ClassTopic.asp
To write the temp file I would start here: http://msdn.microsoft.com/library/de...ClassTopic.asp
To execute the temp file I would start here: http://msdn.microsoft.com/library/de...tartTopic3.asp
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:6f**********************@newssvr11.news.prodi gy.com...
Jay B. Harlow [MVP - Outlook] wrote:
copyco,
Well, I was thinking I might be able to dynamically edit the html document and then export it.
Explain "export it", HTML added to a project is going to be "external" to the binary, which means you will need to add it to your setup project to have it deployed. Alternatively you can set the "Build Action" to "Embedded Resource" to have the HTML file embedded into your executable, which means you may then need to "export it" to a file, to actually use it. The Build Action is available from the properties window when you select the file in Solution Explorer. You can use a ResourceManager and/or ResourceReader to get at the embedded file in your executable. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible?
You could use either the COM Script control, or Process.Start to exectu Or does the VBScript have to be external to the project?
You could have the VBScript embedded in the executable like you can an HTML file.
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:5h**********************@newssvr11.news.pr odigy.com...
Herfried K. Wagner [MVP] wrote: >* copyco <co****@anon.com> scripsit: > > > >>Can anyone tell me what the purpose is to adding items such as a >>VBScript file or HTML document to your VB.NET project? Once you have >>these things added, how to you access them and use them in your code? > > >What exactly do you want to do with the files? >
Well, I was thinking I might be able to dynamically edit the html document and then export it. Or with the VBScript, pass some parameters to it from my WinForm code and execute it. Is this possible? Or does the VBScript have to be external to the project? Ok let's say I have a VBScript file embeded in my executable. How would I write the code that would execute the script?
Actually, I'm using System.Web.Mail.MailMessage and
System.Web.Mail.SmtpMail.SmtpServer to send an e-mail message. The
problem is that I have .NET Framework v 1.0 which does not support SMTP
authentication. However, I'm able to write VBSript that does. I just
was wondering how I could execute the script from the executable itself
instead of run it externally. It just seems to be a clumsy way of doing
it.
copyco,
How does that saying go: use the right tool for the right job? :-|
Correct! System.Web.Mail does not handle SMTP authentication.
I would think that if you have a VBScript that does authenticated email,
than you can use the same code in VB.NET to also do authenticated email. As
VB.NET handles COM (almost) as easy as VBScript handles COM.
I would think our time would be better served figuring out how to convert
your VBScript code to VB.NET and getting it to run, rather then how to run
VBScript code from .NET...
For starters I would cut & paste the VBScript code into a new VB.NET source
file that has Option Strict Off & Option Explicit Off (which is most
VBScript like).
Hope this helps
Jay
"copyco" <co****@anon.com> wrote in message
news:v2*******************@newssvr24.news.prodigy. com... Jay B. Harlow [MVP - Outlook] wrote:
<snip>> Actually, I'm using System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail.SmtpServer to send an e-mail message. The problem is that I have .NET Framework v 1.0 which does not support SMTP authentication. However, I'm able to write VBSript that does. I just was wondering how I could execute the script from the executable itself instead of run it externally. It just seems to be a clumsy way of doing it.
Jay B. Harlow [MVP - Outlook] wrote: copyco, How does that saying go: use the right tool for the right job? :-|
Correct! System.Web.Mail does not handle SMTP authentication.
I would think that if you have a VBScript that does authenticated email, than you can use the same code in VB.NET to also do authenticated email. As VB.NET handles COM (almost) as easy as VBScript handles COM.
I would think our time would be better served figuring out how to convert your VBScript code to VB.NET and getting it to run, rather then how to run VBScript code from .NET...
For starters I would cut & paste the VBScript code into a new VB.NET source file that has Option Strict Off & Option Explicit Off (which is most VBScript like).
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:v2*******************@newssvr24.news.prodigy. com...
Jay B. Harlow [MVP - Outlook] wrote:
<snip>>
Actually, I'm using System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail.SmtpServer to send an e-mail message. The problem is that I have .NET Framework v 1.0 which does not support SMTP authentication. However, I'm able to write VBSript that does. I just was wondering how I could execute the script from the executable itself instead of run it externally. It just seems to be a clumsy way of doing it.
I tried your suggestion but it isn't working. It gives me the error
'The "SendUsing" configuration value is invalid.' However this code
works fine as a VBScript. I'm just about ready to throw up my hands and
just call the script from my executable. Here's the code below.
Perhaps someone can point out the error.
\\\
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objEmail = CreateObject("CDO.Message")
'Dim objEmail As New CDO.Message()
objEmail.From = "my_email@my_isp.net"
objEmail.To = "so*****@somewhere.now"
objEmail.Subject = "test message"
objEmail.TextBody = "This is a test."
objEmail.Sender = "my_email@my_isp.net"
With objEmail.Fields
..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.swbell.yahoo.com"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
..Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"my_email@my_isp.net"
..Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"my_password"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
End With
objEmail.Configuration.Fields.Update()
objEmail.Send()
End Sub
///
copyco wrote:
Jay B. Harlow [MVP - Outlook] wrote:
copyco, How does that saying go: use the right tool for the right job? :-|
Correct! System.Web.Mail does not handle SMTP authentication.
I would think that if you have a VBScript that does authenticated email, than you can use the same code in VB.NET to also do authenticated email. As VB.NET handles COM (almost) as easy as VBScript handles COM.
I would think our time would be better served figuring out how to convert your VBScript code to VB.NET and getting it to run, rather then how to run VBScript code from .NET...
For starters I would cut & paste the VBScript code into a new VB.NET source file that has Option Strict Off & Option Explicit Off (which is most VBScript like).
Hope this helps Jay
"copyco" <co****@anon.com> wrote in message news:v2*******************@newssvr24.news.prodigy. com...
Jay B. Harlow [MVP - Outlook] wrote:
<snip>>
Actually, I'm using System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail.SmtpServer to send an e-mail message. The problem is that I have .NET Framework v 1.0 which does not support SMTP authentication. However, I'm able to write VBSript that does. I just was wondering how I could execute the script from the executable itself instead of run it externally. It just seems to be a clumsy way of doing it.
I tried your suggestion but it isn't working. It gives me the error 'The "SendUsing" configuration value is invalid.' However this code works fine as a VBScript. I'm just about ready to throw up my hands and just call the script from my executable. Here's the code below. Perhaps someone can point out the error. \\\ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objEmail = CreateObject("CDO.Message") 'Dim objEmail As New CDO.Message() objEmail.From = "my_email@my_isp.net" objEmail.To = "so*****@somewhere.now" objEmail.Subject = "test message" objEmail.TextBody = "This is a test." objEmail.Sender = "my_email@my_isp.net"
With objEmail.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.swbell.yahoo.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "my_email@my_isp.net"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "my_password"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 End With
objEmail.Configuration.Fields.Update()
objEmail.Send()
End Sub ///
Hey nevermind. I got it working. I used the CDO.Configuration object
for the fields and that worked. Thanks for all the help. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brad |
last post by:
I'm somewhat of a "newbie" when it comes to programming, so please bear with
me <grin>
Does this work well for combining dissimilar language web projects?
Using the "File" - "Add Project..."...
|
by: nospam |
last post by:
THIS IS the DOTNETJUNKIES MESSAGE
-------------------------
We're Sorry
As many of you know we have recently launched SqlJunkies.com. We have
overhauled our runtime and will be using it on...
|
by: Ian Hinson |
last post by:
The pop-up (drop-down?) menu items that appear in both built-in and custom
menubars since Office 2000 now sometimes appear "sunken" and by default are
not visible, unless the chevron is clicked at...
|
by: Raghavendra Mudugal |
last post by:
Hello Everybody,
We are creating a new project on Virtual Private Networking (VPN),
and it is decided to use VC++. I actually want to know that
is can be achived by VC#.NET or not. You all know...
|
by: Mark Poppers |
last post by:
I found a *.sln and an *.suo file which belong to my current project because the have the same name
"TestDatabase33....." as my project.
What is the purpose of these files ?
If I delete them...
|
by: TS |
last post by:
I cannot get this to work. I added an app.config to a project i reference
from my web application project (vs 05) but can see no way to access the
settings within it.
the other thing is that I...
|
by: Alan Mailer |
last post by:
Again, I'm new to VB.net and there is something I need help with:
Like (I assume) many of us, over time I want to be able to create some
VB.net classes that I might want to use in more than one...
|
by: 97612 |
last post by:
Purpose: Convet the project " ImageStone "(with source code) to a DLL
Platform: Visual Studio 2005 on Windows Vista
What I've done:
1. Create a empty DLL project and add all the source codes...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |