|
A customer wanted a form to email him at home, so I banged out a script to do so. Much to my surprise, it worked the first time (I've never tried it before). In the script I use a CreateObject() function to generate a new Mail object, and when it's all assembled I use Mail.Send to cast it forth upon the ether. A nagging thought I'm having is, what happens to that Mail object after the message is sent? What is its lifetime? Should I follow the send command with a Set Mail = Nothing statement to ensure its release?
Instead of marrying again, I think I'll just find a woman I don't like very much and give her a house...
|
|
|
|
|
It is always a good Idea to set your object to nothing when finished. In ASP unless otherwise set Objects have page scope. That is to say if you create the object on the page when the page is finished being used the objects will be cleaned up.
|
|
|
|
|
Steven Szelei wrote:
It is always a good Idea to set your object to nothing when finished.
That seemed likely, but VBS is new to me. Better to form good habits now, than to try to break bad ones later... Thanks for the info
Instead of marrying again, I think I'll just find a woman I don't like very much and give her a house...
|
|
|
|
|
<joke>
Dim myObject
Set myObject = CreatObject("SomethingNeato")
myObject.CanDelete = False
myObject.Scope = ENOUGH_TO_CRASH_SYSTEM_REALLY_QUICK </joke>
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"The height of your accomplishments will equal the depth of your convictions."
- William F. Scolavino
|
|
|
|
|
I am attempting to move my old asp code over to asp.net but have run into the following problem. Inside a class page I am trying to get the host address. The Request.UserHostAddress function works perfect in the aspx page but will not work in the vb class. This is because Request is part of the Page method which is not available to classes. The obvious work around is to pass in the address from the aspx page, but I would like to know if there is a better way this could be done. I appreciate any help that can be provided.
Thanks
Jason
Jason W.
|
|
|
|
|
Try:
HttpContext.Current.Request.UserHostAddress
|
|
|
|
|
Why do you continue to ask PHP questions in a forum about HTML/ASP/ASP.NET?
You might get a better response by finding a PHP forum.
|
|
|
|
|
This is obviously a site and forum dedicated primarily to MS technologies. You will get better responses by searching a PHP oriented site.
|
|
|
|
|
Good way there to say sorry!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Mark Nischalke wrote:
You will get better responses by searching a PHP oriented site.
Or by not deleting the post so that when someone who actually knows PHP stops by can answer it. What's the question and who asked it?
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"The height of your accomplishments will equal the depth of your convictions."
- William F. Scolavino
|
|
|
|
|
me.
i noticed a function, unset , and wondered if you were supposed to use it to destroy variables at the end of functions.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
You can use unset() to explicitly destroy variables, but variables are destroyed at the end of the life of their scope anyway. So, unless they are static or have global scope they'll be cleaned up at the end of the function. For instance, if I use a local variable $foo in the function bar , it'll be destroyed anyway when bar returns.
In short, you don't have to. And, you'll find this method of variable handling holds true in many languages other than just PHP.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"The height of your accomplishments will equal the depth of your convictions."
- William F. Scolavino
|
|
|
|
|
RTFM - unset()
Honestly - when learning PHP, the PHP Manual is your best friend.
Jon Sagara
"Me fail English? That's unpossible."
"Hello Supernintendo Chalmers. I'm lernding."
--- Ralph Wiggum ---
|
|
|
|
|
Hmmm...ok, I'm stumped here, reading Professional ASP.NET from Wrox and it says in Ch. 23 that to get the IP address of the user from the Request object you use UserHostAddress and to get the browser you should use UserAgent , however I can't get either to work at all, does anyone have any clues, the only example I have seen is a really ugly iteration of Request.ServerVariables through several arrays which I feel is a tid bit much. Where am I going wrong here? Thanks in advance.
Nick Parker
|
|
|
|
|
Nick Parker wrote:
Professional ASP.NET from Wrox
Sorry Nick,Is that good book? I have doubt to buy it.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Actually Mazy, I am pretty happy with it so far, there are a lot of examples, just not quite sure why I can't get the above to work. I will figure it out eventually, hopefully sooner than later though.
Nick Parker
|
|
|
|
|
The Request.UserAgent and Request.UserHostAddress should work fine.
Try creating a file called "test.aspx", and paste in the following:
<script language="vb" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Response.Write(Request.UserAgent & "<br />")
Response.Write(Request.UserHostAddress & "<br />")
End Sub
</script>
Load that page and see what happens. On my machine, the response is:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; .NET CLR 1.0.3705)
127.0.0.1
|
|
|
|
|
Yeah, I actually got it last night, I was trying a little too damn hard thinking that I would need to do something like Response.Write(Request.ServerVariables("UserAgent")) when all I needed to do was drop the ServerVariables("") stuff. Thanks for the response.
Nick Parker
|
|
|
|
|
I have found a place on the internet that can offer you ASP.NET support for FREE!
Check this out: http://www.brinkster.com/registration/default.asp
If you look at "General Solution" you can create a FREE account with ASP.NET support!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I have brinkster and it is painfully slow. But if it works for you go for it.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
Well... my forms authentication doesn't work!
I have the a can get to the protected page without logging in... wird... I think there is something in the Web.config file!
(I testing the same code that Jeff Prosise wrote in an article in MSDN Magazine, May 2002 Vol 17 No 5)
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I've had a Brinkster website and it wasn't too bad.
They do advertise it as more of a demo/prototype/test environment than a production site.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
SimonS wrote:
They do advertise it as more of a demo/prototype/test environment than a production site.
I guess that that would explain the performance issues.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
Do they let you have access to stuff that I can currently only do by going to the IIS Admin Tool, i.e. set up error pages, etc.?
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Domenic [Geekn] wrote:
Do they let you have access to stuff that I can currently only do by going to the IIS Admin Tool, i.e. set up error pages, etc.?
If they do I never found it (I doubt they do)
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|