|
Tina P wrote: i'm doing some processing within the file
Are you not closing the file after use?
Tina P wrote: says that the file is being used by another process.
I don't think there is no other way to know the file in use other than catching the exception raised by File.Delete.
|
|
|
|
|
After processing the file make sure that you are disposing the filesystem objects properly. If you close and dispose the objects, you will be able to delete it without any problem.
*jaans
|
|
|
|
|
Thanks guys, Yes I'm using a text field parser (Microsoft.VisualBasic.FileIO namespace) and i guess it was not getting disposed off properly eventhough I was using the using syntax
Thanks
Tina
|
|
|
|
|
Tina P wrote: Apparently the process is not releasing this file and that's why it throws an exception that says that the file is being used by another process.
Can you please put the line of code ? are you using Process any where of the code ?
|
|
|
|
|
You are doing some processing in the file after opening it.For that are you creating an object of StreamWriter or some other class? If yes the you need to close/dispose that object
|
|
|
|
|
I ran into a similar issue. Turns out that the code runs faster than the OS. There was a short lag between the code closing the file and the OS releasing the open handle on it. I wrote a loop that would attempt to delete every 1/10 of a second or so for a few seconds until either the file was deleted or the expired time passed.
|
|
|
|
|
Interesting...all I had to do was to explicitely close those three readers that I was using in combination by calling .Close() on them.
|
|
|
|
|
Hi all.
I have a simple urlrewriter.
I want to rewrite some path such as mysite/Sale to a special page with parameter like mysite/Find.aspx?y=sale
But when I rewrite HttpCuntex.Request to page find.aspx it raise an error:
Error 404 page not found
can not find mysite/sale/find.aspx?s...
whats problem?
sepel
|
|
|
|
|
sepel wrote: mysite/sale/find.aspx
Is that file exist in mysite/sale path?
|
|
|
|
|
Thanks for your rplay.
No.The
/sale path is virtual.
I want to use some virtual path such as:ForRent,Sale,Apartemant..
sepel
|
|
|
|
|
The error message is straight forward. Well, where is this find.aspx resides? Can you show the code you used for rewriting?
|
|
|
|
|
public class SimpleRewriter : System.Web.IHttpModule
{
..
void context_BeginRequest(object sender, EventArgs e)
{
string newUrl = UrlEngine.Engine.ToRealUrl(_application.Context.Request);
HttpContext.Current.RewritePath(newUrl, true);
}
}
If _application.Context.Request be
mySite/Sale
newUrl get
/Find.aspx?type=Sale value.
Find.aspx is in Root Directory:mySite/Find.aspx
sepel
|
|
|
|
|
sepel wrote: HttpContext.Current.RewritePath(newUrl, true);
A guess. Try passing false to RewritePath method?
HttpContext.Current.RewritePath(newUrl, false);
|
|
|
|
|
It rises error yet:
Server Error in '/MySite' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies)
could have been removed, had its name changed, or is temporarily unavailable.
Please review the following URL and make sure that it is spelled correctly.
Requested URL: /MySite/Sale/find.aspx
I think i must change /MySite/Sale/find.aspx to /MySite/find.aspx .
It means i must rewrite Relative Path of httpCuntex.But I don't know how?
sepel
modified on Tuesday, January 13, 2009 4:54 AM
|
|
|
|
|
Hi!
I have this strange requirement.
I need to restrict users to a website from certain machines. MAC address is stored in the database and should be validated before authenticating the username/password.
Can you provide me any suggestions about how to do this?
I have been told to create a dll and call it from javascript. Is this possible or what?
Any help will be highly appreciated.
Thanks..
|
|
|
|
|
That's only possible if the dll is a registered COM server. For more info see this thread: http://p2p.wrox.com/topic.asp?TOPIC_ID=18052
umerumerumer
|
|
|
|
|
.....and you call through ActiveX object also .
|
|
|
|
|
Another option is AJAX.
|
|
|
|
|
Hi
I have created a website in ASP.NET 2.0 and i have added the reference tro a dll , dll icopied to the bin folder, what i want is that dll's referencedc should be present in other folder not in bin and they are configuration should be in web.config, hows this posssible, kindly reply ASAP, thanks in advance.
regards,
|
|
|
|
|
King Shez wrote: what i want is that dll's referencedc should be present in other folder not in bin and they are configuration should be in web.config
I didn't get your question. When one add the dll as refernce in project then the dll's class is accesible from all the codebehind files in that project.Please check the namepace of the class that dll is giving.
Cheers!!
Brij
|
|
|
|
|
Sorry man, this is not the problem, whenever i add the reference in website in ASP.NET it copies the dll to bin folder, but in webproject it adds th reference in references and we can configured these reference in web.config and we can change the reference path as well from the project settngs, how to do this in website, thanks for your response,
regards,
|
|
|
|
|
We have a FormView control to show customer information with paging enabled in an .aspx page named Customer.aspx. We can navigate page by page to show customer information per page. FormView datasource has been a SqlDataSource control which is calling a stored Procedure. And FormView dataKey has been set to be customerID.
Now in this page FormView nevigation is working well showing customer page by page order by their names.
We have another page named Sales.aspx, from which we can get back to our previous page named Customer.aspx by clicking a button. At this time we are taking a particular customerID in Session and calculation the rowid/position of this customer [with an order by query which is the same with the stored procedure of FormView Datasource]. Now we are doing
FormView1.PageIndex = CustomerPosition;
So that we can directly go to the FormView page where this customer is and as FormView datakey is the customerID we can view this particular customer data in that FormView page.
Instead of this we are having a wrong customer data in that page of FormView. What is more interesting here that not every time this is happening……sometimes it is working fine showing correct customer information in FormView pages and ‘Next’,’Previous’ working fine with correct results. Here by correct customer I mean that particular customer which belongs to that FormView page. We have checked our log file. There we have found out that after FormView pageindex has been changed, sometimes (randomly) FormView.selectedvalue is wrongly referring to a different CustomerID which was not the correct one.
The whole behavior is completely random and does not have a recognizable pattern. Sometimes (randomly) FormView.selectedvalue is choosing a wrong value and it’s a read only field. While running it at our local boxes, the frequency of error is less whereas frequency of error is more when we are running it at our server. We are using windows server 2003, Sql server 2005 and IIS6 and ASP.NET 3.0
Any suggestions will be greatly appreciated. Thanks.
|
|
|
|
|
Double check your sort. Does the order by clause guarantee the same sort every time? If they column list does not include at least one unique value, the answer is no. I ALWAYS include a unique column such as the PK in the sort as the last column if nothing else, when creating stored procs that return records.
Add the PK in your sort.
|
|
|
|
|
Hi all,
i am using a ajax calendar control when i select a date from it i want to do some operations on selection of a date.
How can i do??
Thanks in advance....
|
|
|
|
|
You can handle the "TextChanged" event of the "Textbox". so whenever user changes the date. you can handle the event using TextBox.Text Property.
Select the Textbox which bound with the Calendar Extendar, then go to Property window, Select Events and find the "TextChanged", double click and code for .Text Property. Done.
|
|
|
|