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 1736
* 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: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |