|
leckey wrote: Good luck getting help from anyone now.
I ditto that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Judging by your recent posts, you appear to be both ignorant, rude and stupid. That's quite an accomplishment.
I suggest you pay close attention to the forum guidelines and return again when you have mastered the art of forum etiquette.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: Judging by your recent posts, you appear to be both ignorant, rude and stupid.
That is why I've stopped replying to the person or just give real half-assed replies
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
The web application has a link button which when clicked uses the ID in session and opens ID.doc in another machine.
Here is how I access
http://TestApp/MainPage.aspx, I get the link button and click it and ID.doc opens.
Also, am able to open http://TestApp/Docs/ID.doc [this is the virtual directory path where all the ID.docs reside]
The user should not access http://TestApp/Docs/ID.doc [^]
Do you have suggestions on how to do this?
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
What you can do is to place the file outside of the wwwroot directory, and then stream it to the user when needed. That way the user won't be able to access it directly through a URL.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
|
Michael Sync wrote: If you want the sample, you can check-out this link
http://www.codeproject.com/KB/aspnet/Protect_files_to_downloas.aspx[^]
I guess a simple HTTPHandler approach would be better than this. What do you say ?
|
|
|
|
|
N a v a n e e t h wrote: I guess a simple HTTPHandler approach would be better than this
Yeah. HTTPHandler is much easier than that. no need to touch the IIS setting and just can be done via web.config. but I haven't tried it before..
|
|
|
|
|
Thanks. Took HTTPHandler approach.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
try<br />
{<br />
SqlDataReader reader = null;<br />
components.login comp_login = new Boncet.components.login();<br />
reader = comp_login.checkUser(usernametxt.Text,pwdtxt.Text);<br />
<br />
if(reader.HasRows)<br />
{ <br />
reader.Read();<br />
Session["appeid"] = reader.GetString(0);<br />
Session["emp_id"] = reader.GetString(0);<br />
Session["fname"] = reader.GetString(1);<br />
Session["lname"] = reader.GetString(2);<br />
if(Convert.ToString(reader["mname"]).Length == 0)<br />
{<br />
Session["mname"] = ".";<br />
}<br />
else<br />
{<br />
Session["mname"] = Convert.ToString(reader["mname"]);<br />
}<br />
Session["pword"] = reader.GetString(4);<br />
Session["dept"] = reader.GetString(5);<br />
Session["unit"] = reader.GetString(6);<br />
Session["appraiser"] = reader.GetString(8);<br />
Session["appaid"] = reader.GetString(9);<br />
Session["grp"] = reader.GetString(13);<br />
string userid = usernametxt.Text;<br />
<br />
Response.Redirect("index.aspx?pemp_id=" + userid+"&nam="+Convert.ToString(Session["fname"])+<br />
"&lnam="+Convert.ToString(Session["lname"])+"&dep="+Convert.ToString(Session["dept"])+<br />
"&uni="+Convert.ToString(Session["unit"])+"&grop="+Convert.ToString(Session["grp"])+<br />
"&apaname="+Convert.ToString(Session["appraiser"])+"&apaid="+Convert.ToString(Session["appaid"]));<br />
}<br />
else<br />
{<br />
errorlbl.Visible = true;<br />
errorlbl.Text = "Invalid Staff ID and or Password!!";<br />
}<br />
}<br />
catch(SqlException ex)<br />
{<br />
errorlbl.Text = "System error: " + ex.Message.ToString();<br />
errorlbl.Visible = true;<br />
}<br />
catch(Exception ee)<br />
{<br />
errorlbl.Text = "Wait for some minutes and try again or consult the administrator!";
string datt = ee.Message.ToString();<br />
errorlbl.Visible = true;<br />
}
This code above will sometimes tell the user that null values cannot be called on the method.And it will always be caught by the second catch.Strange thing is that when you restart the IIS, and still use the same ID and pword,the system will accept it and log you on.And after sometime again,it will start telling you that null values cannot be accepted and when u restart the IIS it will be alright again.I have checked all the stored procedures and all the components involved in this login and there is no where a null value can be gotten.I just can't figure out why it is like that.Any help?
|
|
|
|
|
This line will probably throw an error if your returned value from the reader is DBNull.
Convert.ToString(reader["mname"])
I'd also query why you are storing the password in session - should not be necessary.
|
|
|
|
|
no it does not return null.The problem is that itreturns for sometime and then it will start giving this error
|
|
|
|
|
Hi I am using update panel and inside that i use a place holder. When i click a button a specific number of text boxes are created and added to this place holder. Now i would like to get the values / text entered in these dynamically created text boxes when i click another button. But i don't get the text boxes which are created within this placeholder.
Please advice.
Thanks in advance.
Ali
|
|
|
|
|
Hi,
well I just wanted to extend the LinkButton control, actually I wanted to add a property to that so that I can store some useful data within that control. I have made a class as
public class LinkButtonEx: LinkButton
{
public LinkButtonEx()
{
}
private int _CatID;
public int CatID
{
get
{
return _CatID;
}
set
{
_CatID = value;
}
}
}
I wonder how I could use this in designing the page in a way such as asp:LinkButtonEx> . Can u plz tell me how I can do this
Thanks in advance
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
ok I can answer that myself now.
just create a new project of Web Control Library. Build the DLL
Add the reference to the project. the in teh aspx file
<![CDATA[<%@ Register TagPrefix="ext" Namespace="Vizteck.ExtendedControls" Assembly="LinkButtonEx" %>]]>
add this on top of the page.
to use the control do something like
<ext:linkbuttonex text=""><![CDATA[<%#Eval("CatName")%>]]>' runat="server"></ext:linkbuttonex>
and there u are, u can use your control now
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
how can i delete file in server. through server side code
|
|
|
|
|
Did you look at
File.Delete("pathoffile");
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
Friends ,
How can i know the flv file playtime before it is to be played,
just in youtube which shows the total playtime of each video just below the flv player in youtube.
|
|
|
|
|
Hello,
Can anybody help me that, how to check, perticular files have already installed or not in local system during installation of desktop application.
Actually i've created a desktop application. Now for that application, some microsoft.sqlserver files must be installed in the local system.
I want that during installtion of my desktop application, there should be a way for checking that .sqlserver files have installed.
If not then, installer must prompt to the user that those files must be installed for this desktop application. After this, installation should be completed.
Please help me about this asap...
Thanx
Deep
|
|
|
|
|
Hi, I am trying to open a windows application by this code
Process test = new Process();
test.StartInfo.FileName = "C:\\Program Files\\PakInc\\SupnaBurnCDSetup\\CSharpDemo.exe";
test.Start();
windows application is executed but it didn't work properly. Can anybody help me.
Thanks
|
|
|
|
|
arslanjatt wrote: Process test = new Process();
test.StartInfo.FileName = "C:\\Program Files\\PakInc\\SupnaBurnCDSetup\\CSharpDemo.exe";
test.Start();
Process.Start(fileName) will do
arslanjatt wrote: windows application is executed but it didn't work properly.
Which didn't worked properly ? Windows application or the website ?
|
|
|
|
|
Windows application didn't work properly. Act. it is a demo aopplication to burn the cd. windows application is not installed on server not on client.
|
|
|
|
|
Sorry i mean to sya windows application is installed on Web Server not on client. It communicate with the Local System. I can open a NOTEPAD.EXE properly and it work properly also. But, CSharpDemo.exe doesn't work properly.
|
|
|
|
|
arslanjatt wrote: Windows application didn't work properly
What is the error it is showing ? Is all prerequisites for .NET application installed on the machine ?
|
|
|
|