|
I guess u need to save / download image, when u know its url using some procedure.
If this the case u can use WebClient.DownloadFile (simple), or use HttpWebRequest and HttpWebResponse.
cool man
|
|
|
|
|
How can i get asp.net to valid to xhtml 1.1? I keep getting errors on this line:
I assumed it was from the view state, and i set all the view states on my page(hammackj.com) to false and it still appears...any way around this?
|
|
|
|
|
Hi,
It is a bit difficult, because Asp.Net 1.1 doesn't support strict xhtml, but you can look at this article http://www.codeproject.com/aspnet/ASPNET2XHTML.asp[^].
But IMHO it is not that important to have valid pages now (better working, than valid ) because .Net 2 (=Visual Studio 2005 = Whidbey) will support strict xhtml pages (I'm really looking forward to this new version!).
|
|
|
|
|
Thanks so much =) I modified it to work for 1.1 will hold me over till 2005 =)
|
|
|
|
|
I am trying to make a script using JavaScript to display images like Windows Picture Viewer.
This is what I have so far:
Gallery Beta 1[^]
I am having problems with my script online however. It seems to work fine locally, from what I can tell. The problem is I have the image loaded when a picture is clicked, however nothing happens the first time you click it, so you have to click it a second time for the image to be displayed properly. I've been looking through my code to see what I can do to fix it, but for the time being I am stumped. Here is my Java script:
window.onload = init;<br />
window.onresize = getSize;<br />
<br />
var preview;<br />
var path;<br />
var extension;<br />
var previewImage = new Object;<br />
var actualWidth;<br />
var actualHeight;<br />
var thumbnails;<br />
var imageContainer;<br />
var windowX;<br />
var windowY;<br />
var tempWidth;<br />
var tempHeight;<br />
<br />
function init()<br />
{<br />
if (document.getElementById)<br />
{<br />
thumbnails = document.getElementById('thumbnails').getElementsByTagName('IMG');<br />
preview = document.getElementById('previewimage');<br />
imageContainer = document.getElementById('imagecontainer');<br />
}<br />
else if (document.all)<br />
{ <br />
thumbnails = document.all['thumbnails'].all.tags('IMG');<br />
preview = document.all['previewimage'];<br />
imageContainer = document.all['imagecontainer'];<br />
}<br />
else window.alert('Please update to a more current browser');<br />
<br />
previewImage = new Image;<br />
previewImage.src = preview.src; <br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
getSize(); <br />
<br />
click();<br />
}<br />
<br />
function getSize()<br />
{<br />
<br />
tempWidth = actualWidth;<br />
tempHeight = actualHeight; <br />
<br />
preview.style.width = tempWidth;<br />
preview.style.height = tempHeight;<br />
<br />
resizeContainer();<br />
<br />
windowSize();<br />
<br />
checkSize();<br />
}<br />
<br />
function resizeContainer()<br />
{<br />
imageContainer.style.width = actualWidth;<br />
imageContainer.style.height = actualHeight;<br />
tempWidth = (actualWidth / 2) * -1;<br />
tempHeight = (actualHeight / 2 + 75) * -1;<br />
imageContainer.style.marginLeft = tempWidth
imageContainer.style.marginTop = tempHeight
}<br />
<br />
function windowSize()<br />
{<br />
<br />
<br />
if( typeof( window.innerWidth ) == 'number' ) <br />
{<br />
windowX = window.innerWidth;<br />
windowY = window.innerHeight;<br />
}<br />
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )<br />
{<br />
windowX = document.documentElement.clientWidth;<br />
windowY = document.documentElement.clientHeight;<br />
} <br />
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) <br />
{<br />
windowX = document.body.clientWidth;<br />
windowY = document.body.clientHeight;<br />
}<br />
windowY -= 150;<br />
}<br />
<br />
function checkSize()<br />
{<br />
<br />
<br />
if ((previewImage.width <= windowX) && (previewImage.height <= windowY))<br />
{<br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
tempWidth = actualWidth;<br />
tempHeight = actualHeight; <br />
<br />
preview.style.width = tempWidth;<br />
preview.style.height = tempHeight;<br />
}<br />
else if ((preview.width < windowX) && (preview.height < windowY))
{<br />
if (preview.width > preview.height)<br />
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
getSize();<br />
}<br />
else<br />
{<br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height;<br />
getSize();<br />
}<br />
}<br />
else if ((preview.width <= 125) || (preview.height <= 125))<br />
{<br />
return 0;<br />
}<br />
else if ((preview.width > windowX) && (preview.height > windowY))
{<br />
if (preview.width > preview.height)<br />
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
}<br />
else<br />
{ <br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height; <br />
}<br />
getSize();<br />
}<br />
else if (preview.width > windowX)
{<br />
actualWidth = windowX;<br />
actualHeight = (actualWidth * previewImage.height) / previewImage.width;<br />
getSize();<br />
}<br />
else if (preview.height > windowY)
{<br />
actualHeight = windowY;<br />
actualWidth = (actualHeight * previewImage.width) / previewImage.height;<br />
getSize();<br />
}<br />
<br />
}<br />
<br />
function click()<br />
{<br />
<br />
for (var i=0;i<thumbnails.length;i++)<br />
{<br />
thumbnails[i].path = thumbnails[i].src.substring(0,thumbnails[i].src.lastIndexOf('/') + 1);<br />
thumbnails[i].extension = thumbnails[i].src.substring(thumbnails[i].src.lastIndexOf('.'));<br />
thumbnails[i].onclick = clicked;<br />
}<br />
}<br />
<br />
function clicked()<br />
{<br />
<br />
var fullpath = this.path+this.id+this.extension;<br />
previewImage = new Image;<br />
previewImage.src = fullpath;<br />
<br />
actualWidth = previewImage.width;<br />
actualHeight = previewImage.height;<br />
<br />
preview.src = fullpath;<br />
<br />
getSize();<br />
<br />
<br />
<br />
<br />
}
I have a few TODO's. One being I need to clean up my code, second I need to add more comments.
This is my Style Sheet (note that some styles are used on other pages):
<br />
body.splash<br />
{<br />
margin: 0;<br />
background-color: #555555;<br />
color: #EEEEEE<br />
}<br />
<br />
body.gallery<br />
{<br />
margin:0;<br />
background-color: #DDDDDD;<br />
height: 100%;<br />
width:100%;<br />
}<br />
<br />
div.container<br />
{<br />
height="100%"<br />
}<br />
<br />
html.gallery<br />
{<br />
overflow: hidden;<br />
}<br />
<br />
div.preview<br />
{<br />
background-color: #DDDDDD;<br />
width: 100%;<br />
height: 100%;<br />
}<br />
<br />
div.filmstrip<br />
{<br />
position: absolute;<br />
background-color: #DDDDDD;<br />
height: 150px;<br />
width: 100%;<br />
bottom: 0;<br />
overflow: hidden;<br />
overflow-y: hide;<br />
overflow-x: scroll;<br />
white-space: nowrap;<br />
}<br />
<br />
span.thumbnails<br />
{<br />
position:absolute;<br />
height: 125px;<br />
width: 100%;<br />
text-align:center;<br />
}<br />
<br />
.thumbnail<br />
{<br />
padding-left: 5px;<br />
padding-right: 5px;<br />
vertical-align: middle;<br />
}<br />
<br />
.imagecontainer<br />
{<br />
position:absolute;<br />
top:50%;<br />
left:50%;<br />
height:796px;<br />
width:800px;<br />
margin-top:-473px; <br />
margin-left:-400px;<br />
background-color:#DDDDDD;<br />
}<br />
<br />
.previewimage<br />
{<br />
height: 796px;<br />
width: 800px;<br />
overflow:hidden;<br />
}<br />
<br />
.center<br />
{<br />
}<br />
<br />
.middle<br />
{<br />
position:absolute;<br />
top:50%;<br />
left:0;<br />
height:230;<br />
width:100%;<br />
margin-top:-115px; <br />
background-color:#EEEEEE;<br />
text-align:center;<br />
}<br />
<br />
.below<br />
{<br />
font-family:arial;<br />
font-size:12px;<br />
margin:0;<br />
padding:0;<br />
height:auto;<br />
background-color:#555555;<br />
}
The HTML source you can view here:
Gallery Beta 1[^]
Please do not comment on my ugly code, I already know , but if you would like to help me clean it up, feel free !
Thanks in advance!
-Sef
|
|
|
|
|
Hi,
I'm not sure if I can help .. i just quickly checked the code and I think, that the problem is that loading of image takes long time (this is why it works with second click - image is already in cache).
I would try putting code for resizing image into onload event handler of IMG where 'big' picture is displayed.
I'm really not sure.. but maybe..
|
|
|
|
|
Hi All,
I am running IIS 6.0 on Windows Server 2003, along with ActivePerl
5.8.2.808. I run ASPX pages along with CGI scripts. When exporting a
PDF file from an ASPX page via the Crystal Reports API, our website
has randomly generated an error stating that the exported PDF file
could not be accessed because it is in use by another process. Of
course, this file name is unique (based on the IIS SessionID), and no
other process should be accessing this file. After much digging, I
turned on auditing for the directory where the PDF file is created and
found some interesting things. Here's the security audit entry for
when the PDF file is created:
Object Open:
Object Server: Security
Object Type: File
Object Name: D:\webdir\pdfexport\bsosdefh15nlzu550n4i0q55.pdf
Handle ID: 2984
Operation ID: {0,67487325}
Process ID: 2204
Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
Primary User Name: NETWORK SERVICE
Primary Domain: NT AUTHORITY
Primary Logon ID: (0x0,0x3E4)
Client User Name: -
Client Domain: -
Client Logon ID: -
Accesses: READ_CONTROL
SYNCHRONIZE
ReadData (or ListDirectory)
WriteData (or AddFile)
AppendData (or AddSubdirectory or CreatePipeInstance)
ReadEA
WriteEA
ReadAttributes
WriteAttributes
Privileges: -
Restricted Sid Count: 0
Access Mask: 0x12019F
Now here's the next security audit entry that appears in the Event
Viewer when the random error occurs (the user is IUSR_XYZ, the
anonymous web user):
Handle Closed:
Object Server: Security
Handle ID: 2984
Process ID: 3768
Image File Name: C:\Perl\bin\perl.exe
It looks like perl.exe closes the same file Handle ID (2984) as that
which the PDF export process was using above.
Is the OS somehow assigning the same Handle ID to two different
processes (process #2204 and #3768)?
The next thing that happens is the ASPX page tries to write out to the
PDF file using the file Handle ID that was closed by Perl in the
previous entry. I think this is where the error occurs:
Object Access Attempt:
Object Server: Security
Handle ID: 2984
Object Type: File
Process ID: 2204
Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
Accesses: WriteData (or AddFile)
Access Mask: 0x2
Does anyone have any insight into the cause of this problem?
Thanks, Todd
|
|
|
|
|
Dear CPians,
I have noticed that Mozilla renders the padding style in a different way that IE and Opera do...
How can I overcome this problem?
Thank you!
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Mozilla is more standards compliant than IE, so it's probably IE at fault.
One thing you could try is to get it rendering properly in Mozilla, then use this: http://dean.edwards.name/IE7/intro/[^] to make IE7 render it properly
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
That makes Opera less compliant than Mozilla too...
Do you agree?
The point is to make it work, I dont really care who is right and who is wrong. Almost 80% of web browsers are IE5 and above. I dont think that many usres have the patch on IE to make it more compliant.
If there is a trick to make my CSS compatible with all browsers it would be great, otherwise I will go for the IE way, which works fine in Opera as well.
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
theJazzyBrain wrote:
I dont think that many usres have the patch on IE to make it more compliant.
I think you misunderstood the point of the page I linked to - it's not a patch that end users download and install on their computers to make their copy of IE work properly, it's something a web designer can add to their pages in order to make it render properly for anyone using IE (without the end user having to do anything)
This way you just write a single bit of standards compliant CSS, and it automatically kludges it for you to make it work on IE (rather than you having to write the broken CSS yourself)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Do they make anything to allow you to do the opposite?
|
|
|
|
|
What, force Mozilla to have extra flaws and break more just to be compatible with Microsoft's mis-standard?
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Is it better to use Mozilla for proofing then? Even though the majority of browsers use Internet Explorer?
|
|
|
|
|
Hi, everybody. I am beginner in Perl programming and I have the next problem when I try to run my script from shell(in Windows it is cmd.exe). The problem was described in theme. My whole code:
I'll be very thankful for help.
#--My code begins here---------------
#!c:\perl\bin\perl.exe -w
use DBI;
my $dbh = DBI->connect('DBI:mysql:perl:localhost','root','join');
#An error is in the string above
$sth = $dbh->prepare("select * from ever");
$sth->execute;
print "Content-type: text/html\n\n";
&GetFormInput;
#-----------------------Remaining part of code is correct and right-----
sub GetFormInput {
(*fval) = @_ if @_ ;
local ($buf);
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN,$buf,$ENV{'CONTENT_LENGTH'});
}
else {
$buf=$ENV{'QUERY_STRING'};
}
if ($buf eq "") {return 0;}
else {
@fval=split(/&/,$buf);
foreach $i (0 .. $#fval){
($name,$val)=split (/=/,$fval[$i],2);
$val=~tr/+/ /;
$val=~ s/%(..)/pack("c",hex($1))/ge;
$name=~tr/+/ /;
$name=~ s/%(..)/pack("c",hex($1))/ge;
if (!defined($field{$name})) {
$field{$name}=$val;
}
else {
$field{$name} .= ",$val";
#if you want multi-selects to goto into an array change to:
#$field{$name} .= "$val";
}
}
}
return 1;
}
--------------------------------------------------------------------
My folder DBI contains the next modules *.pm:
DBI
DBM
DBD
ANSI
APACHE
FAQ
FILE
GETINFORETURN
GETINFOTYPE
METADATA
MYSQL
NANO
ODBC
PROFILE
PROFILEDATA
PROFILEDUMPER
PROXY
PROXYSERVER
SPONGE
It's clear that's dark.
|
|
|
|
|
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<frameset cols="190px, *" bordercolor="black" border="6" frameborder="1" framespacing="0">
<frame src="left.php" scrolling="no" frameborder="1"/>
<frame src="main.php" scrolling="yes" name="editor_area" />
</frameset>
</html>
*** With the code above i'm getting a 3D border and I want a single or double blackborder..
Anyone know how I accomplish this...?
How do I print my voice mail?
|
|
|
|
|
Hello guys,
I want to run an exe file in ASP. My OS is Win2k and I tried this way,
Dim wsShell, strPath 'Declare variables
strPath = "C:\WINNT\notepad.exe" 'Set the path to your exe file
Set wsShell = CreateObject("Wscript.Shell") 'Create object of Wscript.Shell COM
wsShell.run strPath, 1, True 'Run the exe file
Set wsShell = nothing
(Tried to run Notepad just for testing), it didnt work and no errors. Browser just trying to execute and hanged up for long time.
If anyone aware of a solution for this, pls help.
Thanks in advance,
Janaka
|
|
|
|
|
The problem is that your website is running under the IUSR_MachineName account, which will have it's own desktop. When you launch notepad, it will appear on that desktop rather than the interactive desktop, so you won't be able to see it or interact with it.
By passing True as the last parameter of the Run method, you are telling the Shell object to wait for notepad to exit. Since you can't see it, you can't close it, so it won't exit. Your page will continue waiting for 90 seconds (or whatever IIS is set to), and then throw a script timeout error.
If you start a program which will exit without user interaction, you should be OK. If you need to wait for it to finish, make sure that it runs within the script timeout period. Otherwise, pass False as the last parameter.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Is there anyway I can emulate IE's getAdjacentText() using javascript so I have that function available in FF, etc...?
How do I print my voice mail?
|
|
|
|
|
I'm just starting the design phase of a new website for a favorite charity and could use some guidance. I'm still at the cocktail napkin and pencil stage of development, so a lot of flexibility is still available. First off, I'm using the tools I have on hand; upgrading or buying better tools is out of the question. The development will be done using VB.Net 2003 and Access 2000/2003 and hosting will be on an ASP.Net enabled site.
I want the design to include a public section available to anyone, and a section accessible to members only, via username and password stored in an Access database. Most of the site content, public and private, will be in the same database. The member login will establish the user's level of access - view, change, administer the site - public visitors will have no access to private areas. The functions and information available to each member will be controlled by entries in a local table, Users, specifying the member's role on the site, and the whole database will be password protected. Therein lies the question. This master password will have to be embedded in the script code somewhere to enable the application to open its own tables to verify user status. I'm concerned about this password being discovered by bots and hackers.
I realize that nothing is perfect, but what is currently the best practice for this sort of thing? Should I save it in an Application-level variable? Embed it in a server script? Hide it in a stored procedure and pray that no one ever stumbles across the name of the proc? What is considered best practice for this sort of thing? I know it's done all the time, but I haven't done it yet myself. Thanks for any guidance...
"My kid was Inmate of the Month at Adobe Mountain Juvenile Corrections Center" - Bumper Sticker in Bullhead City
|
|
|
|
|
hi,
Before getting into development i recommand you to go through the concept ' Security in Asp.net '.
Espicially : Type of securities, Role based security etc
Sreejith Nair
|
|
|
|
|
I've stored the password in an encrypted string in the web.config before. The problem then becomes where do you store the key to decrypt it again (so, back to the same issue) In my case it was embedded in the assembly. (Looking back, I would do it defferently now)
Would you not be able to use MSDE? You can hook it up to Access so you can use the design tools there, you can also take advantage of its better security model. You could then allow the ASP.NET account to log into the database through a trusted connection.
I hope this helps.
Do you want to know more?
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Colin Angus Mackay wrote:
Would you not be able to use MSDE?
In theory I could use any of several database engines, but Access is what their hosting service supports. SQL Server is available, but at an additional charge. The encrypted string is probably adequate, though, as the data isn't anything someone would work very hard to get - just a member phone list and such for the members' convenience. It is private, however, and should be kept from the idly curious. Thanks for the idea.
"My kid was Inmate of the Month at Adobe Mountain Juvenile Corrections Center" - Bumper Sticker in Bullhead City
|
|
|
|
|
Hi, I am a little new to the code project. Any way, I have Windows ME and do not have the Microsoft .Net FrameWork. I was wondering if their is a program that can notify me when i get new mail. I would like it if it can surport 2 gmail acounts(My Father and I have one gmail account each and we share the same computer). I would like it to stay in the System tray. I will give a gmail invite to the one you can find a program that I can use. Thanks
|
|
|
|
|