|
System.IO.DirectoryInfo dInfo = new System.IO.DirectoryInfo(Server.MapPath("1"));<br />
if (dInfo.Exists)<br />
{<br />
System.IO.Directory.Move(Server.MapPath("1"), Server.MapPath("2"));<br />
}<br />
I just tried it.Its working fine
Here "1" is folder name
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Thank u all of u, its realy helpfull. I have done my work. Once again thanks
|
|
|
|
|
Hello,
I’m writing a web application that needs to access other web applications. The pages that I need to access use both windows and forms authentication. I need to authenticate the users of my application without prompting for their password a username (they have a password and a username and I’ll use them to log in automatically).
I’ve already made this process for the applications that use forms authentication by making a POST request programmatically.
I need to do the same for the applications that I need to access that are using windows authentication, but I have no idea. Can anyone help me? Thanks.
|
|
|
|
|
how to create dynamic control in asp.net(on end user demand)
help me
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
You can place a content place holder and add controls into that depending on user choice. But you won't be able to make this very generic solution. You should have an idea on the type of controls what user will add
|
|
|
|
|
thanks for reply
first time i do this type of work so which way we arrange control on the page.and how we transfer the information and etc have u any link or example
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
Take Place Holder in page
Create object of control like as
-- TextBox txt1=new TextBox();<br />
---txt1.ID="txt1";
Add this control in placeHolder
<br />
-- PlaceHolder1.Controls.Add(txt1);
To use this control
use findcontrol method
--
string val=((TextBox)this.Page.FindControl("txt1")).Text;<br />
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Hi,
I have used Class library using C# ASP.NET2005 and created a public-private key using Sn -k myfile.snk syntax.
I have signed in the key to the class library created and had builded it.
I have added the dll to the GAC using gacutil /i myclasslib.dll
The dll is successfully added to cache.
Now,
1.How to include the shared myclasslib.dll to my new asp.net c# application?
2.Does the myfile(strongname) created can be used for sharing more than one dlls?
3.If so then how can the stron name can uniquely identify the assembly?
4.Does the c# dll can be used in vb.net windows application?
Thanks,
zari
|
|
|
|
|
zareee wrote: 1.How to include the shared myclasslib.dll to my new asp.net c# application?
If your assembly is added to Global Assembly Cache, then you can add reference to it.
zareee wrote: 4.Does the c# dll can be used in vb.net windows application?
Yes you can use that. It will be in MSIL ( Microsoft Intermediate Language ) format. It doesn't care about C# or VB.NET.
|
|
|
|
|
In add reference i dont have the dll i created. But the dll is there in c:/winnt/assembly.
zari
|
|
|
|
|
Hi
I have got a datagrid which, has an asp:image tag embedded through the columns, i have it pulling in the image url from a database.
It does all this succesfully, but it jus won't render the images in the browser, it jus shows my alternative text.
Is there somthing i am not doing? do i have to write a method for rendering these, if so how would i go about it?
here is my code
any help would be great, cheers
Boyindie
<form id="form1" runat="server">
<div>
<asp:DataGrid runat=server ID=dgImage AllowPaging="True" AutoGenerateColumns="False" DataKeyField="imageId">
<Columns>
<asp:BoundColumn DataField=imageId HeaderText="Image ID" ></asp:BoundColumn>
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate >
<asp:Image runat=server ID=imageHolder imageurl='<%#databinder.eval(container.dataitem,"imageAddress")%> ' Width=60 Height =80 BorderWidth =1 AlternateText='<%#databinder.eval(container.dataitem,"imageAddress")%> ' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn HeaderText="View item" CommandName=getDetails ButtonType=PushButton Text=Select></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection, so can pass SQL query
cmdString.Connection = connection
'Set command string to equal SPROC
cmdString.CommandText = "sp_image"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
'Create dataAdaptor for passing data between .net and mySQL
Dim dataAdaptor As New MySqlDataAdapter
'Sets command object to datAdaptor
dataAdaptor.SelectCommand = cmdString
'Creates a dataset which will be filled with data from
'dataAdaptor
Dim ds As New DataSet
dataAdaptor.Fill(ds)
'Creates Table which is filled data from dataset
Dim dataTable As New DataTable
dataTable = ds.Tables(0)
'Sets datagrids source to datatable
dgImage.DataSource = dataTable
'binds ds to datgrid
dgImage.DataBind()
|
|
|
|
|
hi all,
I got one reuirement that i need to compare two key's of hash table how can it possible,please try to help me out,
Thanks In Advance
Chadragupta
|
|
|
|
|
plz described in brief
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
The keys of a HashTable are stored as object, so you need to cast the keys to the actual type that you are using for key, before you can make a useful comparison between them.
If you are using framework 2, you should be using a Dictionary instead of a HashTable. Then the keys are not stored as object, so you don't have to cast them to use them.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi
how to know session is expired or not.If session is expired then
i want to redirect the user to login page.How can i do this.Please
guide me.
Rahul
|
|
|
|
|
First method
if ( Session["UserId"] == null )
Response.Redirect("Login.aspx");
Second Method
try
{
string UserId = Session["UserId"].ToString();
}
catch(Exception Ex)
{
Response.Redirect("Login.aspx");
}
|
|
|
|
|
Hi Navaneeth
but i have to define somewhere session("userid") somewhere
before writing it on every page. i.e i have to define
on session start event session("userid") or just i have to
write the code on my page.
Rahul
|
|
|
|
|
Obviously, he's assuming you've stored a userId in the session when the user logged in. That is really the most obvious way to keep track of login, and your site obviously supports logging in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes i have keep userid in session when user login.On each and every page
i have to check session("userid")=="" if its null then its redirecting
to login page after 20 min.
df
|
|
|
|
|
Hi,
The way u need to check whether session is null or not is like below...
rahul.net11 wrote: session("userid")==""
if ( Session["UserId"] == null )
Regards,
Sandeep Kumar.V
|
|
|
|
|
If you didn't want to do it on each and every page, you can create a base page which all of your web pages inherit from and just do it in the base page. That is what I have done.
Ben
|
|
|
|
|
rahul.net11 wrote: i have to define
on session start event session("userid") or just i have to
write the code on my page.
Exactly what Christian Graus said
|
|
|
|
|
Thanks
I tried it it working.
Rahul
|
|
|
|
|
Thanks
I tried it its working.One more query i have
define 10 values in different session and when session get expired
then values in my all session gets null or some session values still
remain in session.Because i am sending user to login page i force
user to enter only its password because i am taking its email id on
first page and putting it in session and then checking its password
using its mail id.If values in session (email) is get expired or not?
Rahul
|
|
|
|