|
My comment was that you SHOULD NOT HAVE STARTED A NEW THREAD. Don't just keep repeating your question over and over and over.
|
|
|
|
|
FileInfo file = new FileInfo(Server.MapPath(FilePath));
file.Delete();
above for deleting file path from application
this code not working for folder
How can I delete particular folder??????
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Use the Directory.Delete method.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I used like this
Directory.Delete(dirPath,true);
but not working
please can you give some more clarifications.
You get the best out of others when you give the best of yourself.
|
|
|
|
|
|
dirPath="~/upload/a/1"
1) Exception Information
---
Exception Type: System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\~\upload\a\1'.
Data: System.Collections.ListDictionaryInternal
InnerException: NULL
TargetSite: Void WinIOError(Int32, System.String)
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String path, Boolean recursive)
at Client_ManageMyFile.gvManageMyFile_RowDeleting(Object sender, GridViewDeleteEventArgs e) in c:\Inetpub\wwwroot\DocumentShare\DocumentShare\Client\ManageMyFile.aspx.cs:line 203
HelpLink: NULL
Source: mscorlib
Exception Information
System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\~\upload\a\1'.
at System.IO.__Error.WinIOError(Int32 errorCo
You get the best out of others when you give the best of yourself.
|
|
|
|
|
I want to delete hari folder with files
dirPath="~/upload/a/hari"
I used like this
Directory.Delete(dirPath,true);
but not working
error description using Directory.Delete(dirPath,true):
1) Exception Information
---
Exception Type: System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\~\upload\a\1'.
Data: System.Collections.ListDictionaryInternal
InnerException: NULL
TargetSite: Void WinIOError(Int32, System.String)
StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String path, Boolean recursive)
at Client_ManageMyFile.gvManageMyFile_RowDeleting(Object sender, GridViewDeleteEventArgs e) in c:\Inetpub\wwwroot\DocumentShare\DocumentShare\Client\ManageMyFile.aspx.cs:line 203
HelpLink: NULL
Source: mscorlib
Exception Information
System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\~\upload\a\1'.
at System.IO.__Error.WinIOError(Int32 errorCo
You get the best out of others when you give the best of yourself.
|
|
|
|
|
You are trying to use a virtual path with a file system method. The Delete method can not determine what this path is supposed to mean, as it's not aware of the web application. Even if it could determine that the path is supposed to be a virtual path, it doesn't have any information about the web application so that it could determine where the root folder of the application is.
You have to convert the virtual path into a physical path using the MapPath method.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I want to delete only hari folder with files
after map path
string Path = ~/upload/hari
Directory.Delete(Server.MapPath(Path).ToString(), true);
but not working
please help me
Server.MapPath(Path).ToString() is below
MapPath="C:\Inetpub\wwwroot\DocumentShare\DocumentShare\upload\hari"
thanks for your kind response
You get the best out of others when you give the best of yourself.
|
|
|
|
|
trilokharry wrote: but not working
If you would be a bit more specific, it might be possible to help you.
What happens? Do you get an error message?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Is there a practical memory limit to the amount of session state that be handled in-proc?
At what point does a memory limit make out of proc session state the practical choice for state mangement?
|
|
|
|
|
I work in a web site project and i have this problem.
My forms that load data from xmldatasource run normally in development server but when i test them in iis the data from xmldatasource don't be displayed.
Also the menu control that reads data from web.sitemap file works in asp.net development server but doesn't be dispayed in iis.
Anybody any idea?
|
|
|
|
|
i got problems with my class file. most of the errors saying that 'Object reference not set to an instance of an object'. it looks like all functions in class file cannot be performed, even i do declare the class at code-behind file. do i have to call the class file in .aspx page? like this <%# Imports ... %>. this is page for CheckOut.aspx.vb.
<pre>
Partial Class Checkout_CheckOut
Inherits System.Web.UI.Page
Private order As Order
Private cust As Customer
Private cart As ShoppingCart
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
cart = Session("cart")
If Session("order") Is Nothing Then
order = New Order(DateTime.Now, Nothing, Session("cart"))
Session("order") = order
Else
order = Session("order")
cart = order.Cart
End If
cust = New Customer(txtEmail.Text, txtLastName.Text, txtFirstName.Text, _
txtAddress.Text, txtCity.Text, txtState.Text, txtPostCode.Text, txtPhone.Text, _
txtEmail.Text)
order.Cust = cust
lblSubtotal.Text = order.SubTotal.ToString("c")
lblShipping.Text = order.Shipping.ToString("c")
lblTotal.Text = order.Total.ToString("c")
End Sub
Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As _
System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
' process credit card information here
Dim success As Boolean
success = OrderDB.WriteOrder(order) 'the function WriteOrder from OrderDB class
Session("cart") = Nothing 'can't be performed
Session("order") = Nothing
If success Then
Response.Redirect("Confirmation.aspx")
Else
Response.Redirect("Confirmation.aspx?Error=1")
End If
End Sub
End Class
</pre>
|
|
|
|
|
I can't make sense from the logic, nor do I know what your class objects look like.
But, in the page load event, it appears that not all objects have the chance of being instantiated.
Customer - this is always created
Order - creates a new object unless found in the session object.
Cart - Never creates a new instance and assumes there will always be a "cart" object in session object.
The easiest way is to put a break point on your code and see where it blows up..
|
|
|
|
|
Hi
I have a third party payment system to integrate into my application. The final page in my application displays the order details and allows the user to confirm their order. Upon clicking confirm the order is created and at this point in my code behind file I would like to generate a post to a third party payment form that expects some form post values and the users browser should then be redirected to that page within the same session obviously so that the posted values can be used accordingly.
Any help would be greatly appreciated
Thanks in advance
Andy
|
|
|
|
|
Some API's are easier to work with then you think and while you did not mention which payment API your using, most are similar in how they are used/consumed.
You can use the HttpWebRequest class to post values to a site (e.g. PayPal), but the premise is the same.
Dim req As HttpWebRequest = CType(WebRequest.Create(API_URL), HttpWebRequest)
' Set values for the request back
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"
If you need to post the values to the page and have the user perform some final steps on the page while keeping the user on your site, this can be a little more tricky. You would need to send the identifier for the cart/user from your site, so once they are redirected back to your site,
you can perform the look up and react to the messages sent from the api.
You should look into the documentation of the API though. Most times you can handle all of this without the user ever leaving your site - a much better implementation IMO.
|
|
|
|
|
can any body tell me how to add search option in my website .asp.net with c# output should be in other page
|
|
|
|
|
Please use Google for generic questions such as these. The forums are for specific questions such as you post code and are getting an error.
|
|
|
|
|
Leckey AKA Google super evangelist.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I just don't understand people who spend more time setting up a CP account and posting a a generic question when in the same amount of time they could research their question!
|
|
|
|
|
i changed my domain user password in morning, and after 1 min i wanted to chang password again but i can not , and not changed.but if i want to change tommarow i can. do any body know why.??
can u give me a source too show me the reason of this problem.
|
|
|
|
|
I assume you're trying to do this programmatically? Wrong forum otherwise...
However, this has nothing to do with programming - it is a system policy enforced by your sysadmins. You will experience the same result if you do it manually.
The problem is that people will change passwords repeatedly until the system allows them to use their old password when they are asked to pick a new one (the system only rembers a specific - configurable - number of passwords). So, due to the inevitable stupidity of humans in general and computer users in particular, they have to be thwarted somehow - hence the minimum password age policy. I even think one day is the default in Active Directory (which would make sense as no sane sysadmin would ever use a smaller value or disable the policy).
In case you are the sysadmin and are unaware of this (which could be excused if you're a developer playing with Active Directory, but not otherwise): You will find this in the default domain policy or the default domain controller policy (not so in my own domain at the moment so I can't check and don't remember which). Look around in the security stuff under computer settings (you will of course need to be a domain administrator in order to mess around with it).
If you have accounts that are to be used by services or other software and that can't change, you have the option of disabling password aging for a particular account (on one of the account property sheets) - after assigning it a *really* long, random and complex password, of course.
--
Peter
|
|
|
|
|
I need help on this.
In my project I have a folder called "files". Inside that folder I have many file which I have uploaded. Now ,just by writing the link of the files in the address bar of Web Browser (ex: http://localhost:1234/Server/files/file.rar) anyone can download that file. I want to change that. When the clients are writing the link, instead of downloading the file, another page will be opened (ex: continue.aspx) and by clicking a button on that page, they can download that file (the story is like in rapidshare, filefactory, megaupload ...)
Can anyone tell how this can be done.
|
|
|
|
|
The way I would do this, is to stuff the files in the app_data folder, and read them in code and send them with a response.binarywrite, but only to users who were allowed to access them.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you can save the file in your database then read from database
it is safer but slower
modified on Sunday, May 18, 2008 1:01 AM
|
|
|
|