|
Not read only, or hidden I meant. My mistake in words.
|
|
|
|
|
tjDieHard wrote: the file has no permissions set
Are you sure? It really sounds like a permission problem.
Click the Advanced button in the security tab of the file properties. There you can see all permissions for the file.
---
b { font-weight: normal; }
|
|
|
|
|
I have checked all,and all is okay. If it was a permission would it error this way or would I get the access denied type error?
I m lost
|
|
|
|
|
Whu dont you Right click the file and check the security tab and see if Every one is Entered And have Full Control.
Just Helping if not then Have a nice day sorry to bother.
-- modified at 0:31 Sunday 2nd April, 2006
|
|
|
|
|
If you don't have permission to access a file, the error message you get is that it doesn't exist.
This is commonly found when someone tries to make a web application access a file in a user folder, like for an example the desktop. As the web application is not run under the user's account it can not access files in a user folder.
I still think that it might be a permission problem, especially if you moved the file from some other folder. Then it might still have permission settings from the previous place.
Create a new folder somewhere that you know the application has access, put the file in the folder, and in the advanced security properties of the folder choose to replace all security settings of child objects. That will remove any specific settings on the file. Now try to access the file.
---
b { font-weight: normal; }
|
|
|
|
|
Hi!
Could it be that your Windows Explorer is hiding the extensions of known filetypes so that you're seeing "nex_tex.txt" as filename but the true filename is "nex_tex.txt.txt"?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
well turned out to be a corrupted file and poorly written error code on my part. re made the file and all is well
thanks all
DH
|
|
|
|
|
I am using database which content are more than 100 000 rows.
In VB 6, with open data connection, I can view my data after 2 sec. but in C# .NET I am using DataSet but while data are loading to dataset it's take me 30 sec. and set DataGridView.DataSource = MyDataSet takes me next 10 .sec and waiting 40 sec. is too much.
Is posible using open conection in .Net and read only rows what I just need to view alike in VB 6?
DataSet is not just the best solution if you using large Database....
Or how to bind DataReader and DataGrid...?
Can any body help me with this problem... thx
|
|
|
|
|
hi.
can anyone pls tell me how to create a file(and then write to it) using c# on a remote server. for e.g if i want to create a file on my site:
http://www40.brinkster.com/myFolder , assuming "myFolder" has the write permissions.
Thanks.
SA
|
|
|
|
|
How can I forbid the user of a multiline textbox to enter backspace ?
Thanks.
|
|
|
|
|
Handle the KeyPress event off the textbox (or possibly the KeyDown) and discard any characters that match the backspace character (by setting e.Handled to true)
Ed
|
|
|
|
|
In the MFC/Win32 world, my dialog's OnOK() handler would return if a validation error occured or EndDialog (IDOK) if everything was OK. How do I do the same thing in a Form ?
private void OnBtnOK(object sender, EventArgs e)
{
if (validationFails())
return;
else {
}
}
-- modified at 13:39 Saturday 1st April, 2006
this.DialogResult = DialogResult.whatever;<br />
Close();
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Is it possible to enforce that abstract method will be implemented by every class in the hierarchy, even by those classes that derived from classes that ALREADY implemented the abstract method?
Thanks in advanced.
Ilan
|
|
|
|
|
e-laj wrote: Is it possible to enforce that abstract method will be implemented by every class in the hierarchy, even by those classes that derived from classes that ALREADY implemented the abstract method?
No. I not aware of any tricks that will allow that either. You can check the assembly via reflection when it gets loaded an throw an Exception perhaps...
|
|
|
|
|
public abstract class Class1
{
protected abstract void Method1();
}
public interface IInterface1
{
void Method1();
}
public class Class2: Class1
{
protected override void Method1()
{
//....
}
public void HelperMethod()
{
this.Method1();
}
}
public class Class3 : Class2, IInterface1
{
}
this would do it, I don't really see why you would to through all this trouble but it will work.
Class1 is abstract and declares a protected abstract method that Class2 must implement.
Interface1 also requires the same method.
Class3 inherits Class2 and the interface, but because the method is protected, it can't see it, so it needs to explicitly implement it because of the interface, additionally, the HelperMethod gives public access to Method1, this way the method is still public but the Method that follows the rules is not visible to the classes down the hierarchy.
|
|
|
|
|
You missed the keyword, enforce, what he wants to do is perfectly possible, just not enforcable...
|
|
|
|
|
no, I didn't miss it, using the interface in this context has the sole purpose of enforcing it, that's the only reason to declare the same method in an abstract class and an interface, he is still inheritting from the class he wants to inherits but the compiler will force the developer to implement the method in the third class.
And btw, I tested it, if you don't implement the method in the last class you get a compiler error, even though it inherits Class2 that already implemented the method.
|
|
|
|
|
And what about classes inheriting the 3rd class?
|
|
|
|
|
that wasn't the requirement, you can either declare the third class as sealed (then they can't inherit it) or otherwise continue hidding the methods from the child class by declaring them protected and not public, I haven't tested this though.
|
|
|
|
|
I missed something important, interface members have to be public and therefore will be visible to the child classes.
The answer will be that it will work up to the second generation, not beyond, if it's a requirement that classes have to inherit Class3 then it can't be done through design and needs some other solution.
If the requirement is to only inherit from the second class, then all childer classes can be sealed to force to inherit from Class2 or Class1 but not from Class3 and beyond.
Reflection would not be a solution because it would enforce it at runtime, not compile time, basically it would simply throw an error if the separate implementation is not there but it would compile fine.
-- modified at 23:14 Saturday 1st April, 2006
|
|
|
|
|
ricardojb wrote: Reflection would not be a solution because it would enforce it at runtime, not compile time, basically it would simply throw an error if the separate implementation is not there but it would compile fine.
Yes, that's what I told him. I sure as hell hope a person using the code would try debug it at least once, and get notified on the 'enforcement'...
|
|
|
|
|
No I didn't, try it.
what he wants to do is having the compiler enforcing it and the code I posted will just do it.
The interface will require the class to implement the method, normally that wouldn't be enough to enforce to rewrite it because it's already implemented by a parent class, but because it's protected and not public or internal, the child class won't see it and therefore the compiler requires the implementation of the interface.
I didn't say it but it should be obvious that both methods (in the interface and the abstract class) need to have the exact same signature, that is, same name, same return type and same parameters.
|
|
|
|
|
How can I enter in a textbox(for example textbox1) a list of coefficients and convert this list of coefficients from input string to an array of doubles so I can use it to obtain numerator and denominator of a function? Help me please cause I am a beginner.Best regards
|
|
|
|
|
I don't know how you separate each number, but let's assume it's comma separated values, like 1,3,9,75.
The first thing you have to do is separate this values, you can use the Split method of the string class.
char[] separator = new char[1];
separator[0] = ',';
string[] numbers = textbox1.Text.Split(separator);
double[] coeficients = new double[numbers.Lenght];
for (int i = 0; i < numbers.Lenght; i++)
{
try
{
coeficients[i] = double.Parse(numbers[i]);
}
catch
{
}
}
|
|
|
|
|
I have 2 functions PlaySound() & PlaySound_1, I want the PlaySound() will run when Form_Load & the PlaySound_1() will run when a specified function is fired.
And both of those sound don't stop others sound.
How can I do that? Thanks!
Hung!
private void PlaySound()
{
try
{
Sound.PlaySoundWin32("LoopyMusic.wav", 0, (int)(SND.SND_ASYNC | SND.SND_NOSTOP | SND.SND_LOOP));
}
catch
{
if (System.IO.File.Exists("LoopyMusic.wav"))
{
Sound.PlaySoundWinCE("LoopyMusic.wav", 0, (int)(SND.SND_ASYNC | SND.SND_NOSTOP | SND.SND_LOOP));
}
}
}
private void PlaySound_1()
{
try
{
Sound.PlaySoundWin32("time.wav", 0, (int)(SND.SND_ASYNC | SND.SND_FILENAME | SND.SND_NOSTOP | SND.SND_NOWAIT));
}
catch
{
if (System.IO.File.Exists("time.wav"))
{
Sound.PlaySoundWinCE("time.wav", 0, (int)(SND.SND_ASYNC | SND.SND_FILENAME | SND.SND_NOSTOP | SND.SND_NOWAIT));
}
}
}
I have done as follow:
[FORM_LOAD]
Thread thr = new Thread(new ThreadStart(PlaySound));
thr.Start();
[AN EVENT IS FIRED]
PlaySound_1();
Hung
|
|
|
|