Image from folder.
Image from folder.
Image from folder.
Image from folder.
Image from folder.
Image from folder. Image from folder. Image from folder. Image from folder. Image from folder. Image from folder. Image from folder. Image from folder.
Image from folder. Image from folder.
Image from folder.
Go Back  Xtreme Visual Basic Talk > > > Image from folder.


Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2008, 05:19 PM
kingvandal kingvandal is offline
Freshman
 
Join Date: Apr 2006
Posts: 49
Default Image from folder.


I have a small helpdesk app that is built in asp. User authenication is via NT. I would like to add a image next to the name of each person that is a user of the helpdesk. Problem is I have no idea how to make it work. I have currently a folder full of pictures of all users. Their names are stored as their logins are like: JBweld.jpg So in explorer you could type: c:\images\%username%.jpg and the currently logged in users picture would open up. So I was trying to use that type of path in IE but does not work due to the percent sign issues. Is there a way to make a path with the percent signs in it instead of the %25 (which is what appears in place of the % sign) in the path.

Or is there an alternative option for doing this via NT?
Reply With Quote
  #2  
Old 08-27-2008, 07:45 AM
wayneph's Avatar
waynephImage from folder. wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

You're going to have to build the path using basic string manipulation. You'll also need to make sure that the images folder is available via a web share, otherwise you'll have to write additional code to stream the images. (A virtual web share is the easiest.)

Code:
If Me.User.Identity.Name.Contains("\") Then
  url = String.Format("http://myserver/users/{0}.jpg", Me.User.Identity.Name)
Else
  url = String.Format("http://myserver/users/{0}.jpg", _
    Me.User.Identity.Name.SubString(Me.User.Identity.Name.IndexOf("\") + 1))
End If

myImg.ImageUrl = url
If you're using Classic ASP, the theory is similar, but you'll just have to concatenate the strings together and use Request.ServerVariables("LOGON_USER") to get the user name.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Image from folder.
Image from folder.
Image from folder. Image from folder.
Image from folder.
Image from folder.
Image from folder. Image from folder. Image from folder. Image from folder. Image from folder. Image from folder. Image from folder.
Image from folder.
Image from folder.
 
Image from folder.
Image from folder.
 
-->