|
Well there are several ways to do it. But it all boils down to what you have available and how many people will be using it. I did some work for a company that needed something quick to allow them to chat in realtime with customers. They were expecting about 10 concurrent users so I used a combination of cookies and application vars. Application vars carried the actual chat and authenticated via the cookie.
Basically had people log in and they could see only the conversation to which they were invited. Not a very scalible solution but worked perfectly for them.
Fear not my insanity, fear the mind it protects.
|
|
|
|
|
can u please give me some more details like, how do many customers can talk to one guy. like how to chat to each individual in a separate window.
|
|
|
|
|
We have a pay service that provides us information, via web, on a daily basis. I am trying to build an application to automate the logon and file download that a user has to do today. I have started with the webbrowser control to hit the site and login and then use the WebClient.DownloadFile() to get the .PDF files. There web server sees this attempt as two different sessions from different computers. So I added some headers to the webclient to make it look more like the WebBrowser control request:
Me.WebClient1.Headers.Add("User-Agent", "Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SALT+1.0.3404.1+1007+Developer;+.NET+CLR+1.0.3705)")
Me.WebClient1.Headers.Add("Cookie", Me.AxWebBrowser1.Document.cookie())
Me.WebClient1.Headers.Add("Referer", Me.AxWebBrowser1.Document.url)
My last option would be to use Me.AxWebBrowser1.Document.Links(intPDFFileIndex).Click() and a SendKeys combination to do it all from the Web Browser control.
I have not seen much help anywhere for automating downloading of content in .NET. I can't be the only one wanting to do this? Right?
Is there a better approach?
|
|
|
|
|
Hi there
I have a index.html file that contains 3 frames. I would like the header frame to update first, then the navigation bar frame and then the content. At the moment it seems like they are loading simuteonously?? and the "content" which is the smallest of the frames appears first. Is there a method to load the header frame, then the next etc. without slowing the upload process?
tx
|
|
|
|
|
ok dude..basically what you need to do is load the next frame from the previously loaded frame...
so lets say that you a have a frameset composed of 3 frames.. something like:
<br />
<frameset rows="100,*" border=0><br />
<frame src="top.html" name="frame1" border=0 scrolling=no><br />
<frameset cols="50,*" border=0><br />
<frame src="blank.html" name=frame2 scrolling=auto><br />
<frame src="blank.html" name=frame3 scrolling=auto><br />
</frameset><br />
</frameset><br />
so you have frame1 through frame3. Notice that frame2 and frame3 have as a src a blank.html (I'll explain why in a bit).
since you want that frame2 loads after frame1 does... you will place the following code in top.html (the file in frame1)
<br />
<html><br />
<head><br />
<script language="JavaScript" type="text/JavaScript"><br />
<!--<br />
function MM_goToURL() {
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;<br />
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");<br />
}<br />
</script><br />
</head><br />
<br />
<body onLoad="MM_goToURL('top.frame2','left.html');return document.MM_returnValue"><br />
you will do the same thing in left.html (the second frame)...but changing only the target frame and the file to load:
<br />
<html><br />
<head><br />
<script language="JavaScript" type="text/JavaScript"><br />
<!--<br />
function MM_goToURL() {
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;<br />
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");<br />
}<br />
</script><br />
</head><br />
<br />
<body onLoad="MM_goToURL('top.frame3','index.html');return document.MM_returnValue"><br />
thats pretty much it. Keep in mind that every time you reload the site, the process will repeat itself.
hope it works.
luck,
Jon
x-zd Designs
|
|
|
|
|
I'm trying ot use the ASP FileSystemObject to create new folders in my web application and unable to do so.
The FolderExists call seems to work but when the CreateFolder function is called the application locks up. I've tried giving full access to iuser and shared the c:\ drive as well as shutting down zonealarm and norton (Only while offline) but nothing seems to help.
This is the simple code I'm trying to use.
Any hints would be appreciated.
<%
Dim objFSO
Set objFSO= Server.CreateObject("Scripting.FileSystemObject")
'Create the folder
If Not objFSO.FolderExists("C:\newFolder") then
objFSO.CreateFolder("C:\newFolder")
End If
%>
Tom.
|
|
|
|
|
Usually this happens when you have Norton Antivirus installed with Script Blocking enabled (even if NA is disabled by itself). So you should disable the script blocking in Norton to be able to use FileSystemObject. To read more about this problem, here is the link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;295375[^]
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Hi, everyone!
I have referenced a lot of materials but still do not
understand the meaning of the event.
for example,
--------
<BODY scroll=no ONLOAD="initialize()" ONSELECTSTART="return false" TOPMARGIN="0"
LEFTMARGIN="0" topmargin="0" marginheight="0" marginwidth="0" class = "color1">
--------
Who can give me a simple explanation about the meaning and function of
ONSELECTSTART?
Thanks in advance,
George
|
|
|
|
|
George2 wrote:
Who can give me a simple explanation about the meaning and function of
ONSELECTSTART?
Basically it lets you catch the begining of the onselect event of many elements on the page. Select happens when you click on an element or navigate to it (using tab, shortcut keys, autofocus etc.)
So you could catch the begining of the select event of a hyperlink, check something else and then return either true or false to let the rest of the event through or cancel it (maybe the person could only select the hyperlink if they have typed in something in anothe text box for instance.)
Frankly though it sounds overly complex and I have never seen it used (or even heard of it) before today. OnClick/OnSelect etc. give most of the control you need.
I think the more important question is: Why do you want to know about ONSELECTSTART and why are you putting it on the BODY element? What is your requirement?
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
DavidW wrote:
You are totally mad. Nice.
|
|
|
|
|
Thanks, Paul buddie!
I am just reading source codes of a project for
learning purpose.
George
|
|
|
|
|
|
I develop a web site by ASP and SQL Server.
The connection to SQL Server is stored in the Application object : Application("Connection"). (That database connection is established in the global.asa). I use only this connection for all ASP pages. But I am so confused that what will happen if there are many pages (which are accessed from many clients) use the same connection at the same time? And can I use the Application.Lock...
Please explain me if my way is right ?
|
|
|
|
|
Don't do it that way is the simple answer.
There are two ways you should do it, based on the traffic and resources of your site.
First way is for small sites where scalability etc. is not as important and where you cannot afford to do things the second way. This is to open the connection each time you need it and then close it right after you have used it. Open late, close early.
The second way is to use a COM component which has a pool of database connections. Your ASP code then never talks directly to the database, but rather speaks to your data access layer which is in the COM component and which manages the connections. There is a very good article on pooling right here on CP (but I can't find it. Just look for database connection pooling or thereabouts.)
Application.Lock is probably a bad idea because you then have to managed it very carefully and have a transactional system. What happens if an error occurs after an Application.Lock but before the unlock? Your error handling has to be very good and really it sounds like a nightmare.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
DavidW wrote:
You are totally mad. Nice.
|
|
|
|
|
Thanks so much. But please show me the risks when only one database connection was use for all pages. I'm using only one database connection for my web project but I cannot find errors...I don't know when???
Can I use the connection pooling which is provided by the ODBC 3.0 through ADO (without COM, as our ealier discussion)?
Suppose that we use the connection pooling technique and SQL Server is licensed for 5 clients (maximum 5 connections at a time), what will happen if there're more than 5 web-clients request at the same time?
|
|
|
|
|
Can anyone help to show me the best way to manage user session. I am using the Session object to store user session after user log in but I see that it not good and not stable. I am starting with ASP so that I do not have enough experience.
Thanks for any helps.
|
|
|
|
|
I would try to use cookies instead of session vars if possile. Now cookies can be a hassel too, but it is far more scalible.
Fear not my insanity, fear the mind it protects.
|
|
|
|
|
What will happen if the browser is disabled to use cookies?
|
|
|
|
|
You have to use a combination of 3 things:
- database;
- session vars;
- cookies
You can use cookies to leave some portion of the data in the users computer but for a session you wouldn't have to rely on persistent cookies. You should use per session cookies (see this option in Internet Options in IE) just to store an SID (session id) and the rest of the variables should be stored in the db. In every page you will get the sid, query the db and get all the variables you need for that session. It's even secured this way.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
suppose i have 5 pages on my website. if i visit page2 from clicking a link on page1, how will page2 know that from which page i was called.
can anyone help me with that? plz
|
|
|
|
|
Hi,
a few ways you can do this... not sure if you wanted to do this server side or client side so here's both:
for server side (asp):
Request.ServerVariables("HTTP_REFERER")
for client side (javascript):
document.referrer
both of these will return a string which will look something like this:
http://servername/page1.html
HTH
|
|
|
|
|
I am building a site for a DVD rental company and I am wanting to have entertainment news stories (like a mini-blog) on my front page with a short blurb, the date, and a link. Does anyone know of any entertainment news web services? I would prefer a free one, but let me know of any that you would recommend even if they cost money. I can just write a web client and parse a page using regex, but it's harder that way and destined to fail as soon as the news web site I'm pulling from changes.
Any suggestions?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hello all,
I have text as multiple lines in a RichTextBox in my application. How can I programmatically bullet them ?
Thanks
Smitha
The future belongs to those who believe in the beauty of their dreams.
--Eleanor Roosevelt
|
|
|
|
|
You need to send mail in a free hosting that does not support mail object (like free account of brinkster)this is a solution:
Try my demo:
http://www25.brinkster.com/vokha/mail.asp
This is my code(This code using CDOSYS to send mail):
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Source code send mail in anyhost that support ASP and run below Windows 2000
'This source code send mail using a remote SMTP server that support open relay
'If you can't send mail in any server by this code. Please contact me. Because I using another
'server to send mail. So if someone change my password. It doesn't work. To make it work you
'should go to http://online.ie/registration/index.adp (Or any SMTP Server that support open relay). Register an account
'and place your username and password in the following code
'
' objConfig.Fields(cdoSMTPServer) = "Your server"
' objConfig.fields(cdoSendUserName) = "Your account"
' objConfig.fields(cdoSendPassword) = "Your password"
'
'Written by: VO KHA
'Email: one_puppy@yahoo.com
'Website: http://www.qitt.com, http://www.qitt.com/forum/
'Referce: msdn.microsoft.com, file cdosys.idl
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if(trim(Request.Form("btnSend")) <> "") then
Dim strFrom, strTo, strSubject, strBody
strFrom = trim(Request.Form("txtFrom"))
strTo = trim(Request.Form("txtTo"))
strSubject = trim(Request.Form("txtSubject"))
strBody = trim(Request.Form("txtContent"))
call CDOSYSSendMail(strFrom, strTo, strSubject, strBody)
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function CDOSYSSendMail(strFrom, strTo, strSubject, strBody)
Const cdoSendUsingPort = 2
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objMessage, objConfig
Set objMessage = CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = "mail.online.ie"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoBasic
objConfig.fields(cdoSendUserName) = "one_puppy"
objConfig.fields(cdoSendPassword) = "testme"
objConfig.Fields.Update
Set objMessage.Configuration = objConfig
objMessage.To = strTo
objMessage.From = strFrom
objMessage.Subject = strSubject
objMessage.TextBody = strBody
On Error Resume Next
objMessage.Send
If Err.Number = 0 Then
Response.Write("Send successful!")
Else
Response.Write("Cannot send your email: Error " + err.Description )
Err.Number = 0
End If
On Error Goto 0
end function
%>
From: | | To | | Subject | | Content: | <%=strBody%> | | | | | |
|
Welcome to my website:
www.qitt.com
You can win if you want
|
|
|
|
|
Hi,
I think whatever you are saying is not a Open Relay, if I am right. You are sending mail through the SMTP servers with the mail account for which you have registered for yourself.
Perhaps for definitions of Open Relay and Third Party Relay, please check this URL.
http://mail-abuse.org/rbl/relay.html
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Hi
I have a problem with font sizes on my webpage. At the moment I'm using
which shows fine on my browser, but way too small on others (all viewed on 1024 x 768 resolution). If I set the size to '2', the font is way too big on my browser, but OK on other browsers.
And don't want fixed font sizes, so what is the best option?
tx
|
|
|
|