|
Hello evertbody,
I wanted to know how to find the contents of cache memory in c#.Can anobody give a hint or a code snippet for this problem..
Thanking in advance
Swapnil
|
|
|
|
|
Cross post from different ID ...
Why do you need to create more than one id for you ... ??
|
|
|
|
|
Ya right I want to get contents of computers cache memory..
actually I want to get contents of mozzila's cache memory...
Do you have any Idea?
|
|
|
|
|
I didn't understand your question properly. Are you saying you want to scan Cache and find if the required info has been present?
|
|
|
|
|
Hi,
Actually I am developing a tool to check the performance of a site. so whenever I enter a site I want to know is the contents of the url are present in cache or not and if present want to display the contents. So do you have any idea about it. I want to do this in c#.
|
|
|
|
|
Hi, all,
I am doing with a custom control in WinForms, and there is one customed integer type property, say, currentLine , declared in that custom control class with the following code:
private int currentLine;
public int CurrentLine
{
get { return currentLine; }
set { currentLine = value; }
}
but this property's value should be restricted between 1 and 100.
How to make this happen, so that a value smaller than 1, or bigger than 100 is rejected to be entered in properties window at designer time?
Any suggestions are so much appreciated!! Thanks.
Br!
Sun
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:30am.
|
|
|
|
|
thank you, stancrm,
I've tried this, I added one method, OnCurrentLineChanged() in the SET of that property, and the method is as follows:
private void OnCurrentLineChanged()
{
if (currentLine < 1 || currentLine > 100)
{
throw new System.ArgumentException("Property value is not valid", "original");
}
}
However, I don't know for what reason, it doesn't work when I go designer window and try a number like 123.
Any idea with this?
Br!
Sun
|
|
|
|
|
Hi, stancrm,
You are right. I did this exception in the wrong place, and with a wrong exception name as well . I noticed it after I read Sur's reply.
Anyway, Thank you two!! A lot!
Br!
Sun
|
|
|
|
|
Leapsword Sun wrote: public int CurrentLine
{
get { return currentLine; }
set { currentLine = value; }
}
change this to
public int CurrentLine
{
get { return currentLine; }
set {
if(value < 1 || value > 100) throw new ApplicationException("Invalid Input");
currentLine = value;
}
}
This will throw an exception for invalid values. You can modify this according to your need. Just modify the set portion of CurrentLine
|
|
|
|
|
Hi, Sur,
Thank you so much! This solved my problem. Really, thanks a lot!!
Br!
Sun
|
|
|
|
|
Hello evertbody,
I wanted to know how to find the contents of cache memory in c#.Can anobody give a hint or a code snippet for this problem..
Thanking in advance
Swapnil
|
|
|
|
|
are you talking about HttpContext.Current.Cache ??
Or you mean Computer cache memory ??
|
|
|
|
|
Hi,
I'm writing a code where one file is logging data constantly every 2 seconds , which should be opened by other process which keeps updating the log from file.
I have written code , but it is reading only after the logging file is closed , I would appreciate anyone give me some pointers as how can I open same file in 2 processes.
I have opened file using this parameters;
Program 1:
FileStream fileStream = new FileStream(
@"C:\WINDOWS\system32\Logfiles\MSFTPSVC1\ex091021.log",
FileMode.Append,
FileAccess.Write,
FileShare.ReadWrite);
Thanks,
|
|
|
|
|
|
|
okay,
we know that we can reference third party DLLs in a Visual studio project. But while referencing we need to set copy local=true. So that the referenced dll is copied to the start up path. But i failed to reference a dll that will be located to some other folder. For example my project is in D:\\MyProject. And i want to reference a dll in C:\MyDLLs, without copying the dll to my prjects start up path.
How can i do that? I have tried many approaches like editing the codebase element in app.config file.
|
|
|
|
|
Why do you need to do that ? The whole paradigm of .NET is to copy dlls locally.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
actually i want to place all required dlls to a separate folder other than the application.startup folder. So that while shipping the product all the executables refer to a same directory of dlls. Are there any methods so that i can change the default folder where the dlls are copied instead of start up path?
|
|
|
|
|
change the output path for each project class library to your directory, and reference the dlls of your main project from that particular directory.
Also place 3rd party dlls inside that directory and reference it from there.
If 3rd party dlls are installed in GAC, select the dll after being referenced, and go to properties(from 2008 IDE). In the properties window set CopyLocal to true.
|
|
|
|
|
|
Hi
I'm trying to create PowerShell Cmdlets from C#, I'm able to create the Cmdlets and register it and it works fine as well. It looks like i need to create a separate class for every Cmdlet, Is it correct? Let's say following code is to create one Cmdlet and if i want to create another Cmdlet called Get-Process do i need to create new class and write?
[Cmdlet(VerbsCommon.Get, "Proc23")]
public class TouchFileCommand : Cmdlet
{
private string path = null;
[Parameter(Mandatory = true)]
public string Path
{
get
{
return path;
}
set
{
path = value;
}
}
protected override void ProcessRecord()
{
if (File.Exists(path))
{
}
}
}
|
|
|
|
|
First i thank every one replay to my message
but I demand idea not person helping me in making project
i said 50:50 that mean the idea not defficult and not easy
finaly thanks for you and I still not find the good
and i want heping from any body and i will not forget any body who will help me
action57392@hotmail.com
|
|
|
|
|
I'm not sure what's dumber. Posting a thank you like this, instead of within the thread, or posting your email address, which means that web spiders will find it and spam you.
I got what you meant, I also clarified it. However, your overall request was dumb enough that people thought the worst.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Abdaqader wrote: I demand idea
Oh dear. I appreciate that English isn't your first language, but you don't demand things, you request them. Demand implies a command and, frankly bubba, I don't answer to you.
Abdaqader wrote: and i want heping from any body and i will not forget any body who will help me
The point is, it's your course. The subject has to be something that you will feel comfortable with. I have no idea what your skill level is. What's easy to me could prove mind blowingly impossible to you.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|