|
What error message is displayed when started from network drive? What .Net framework are you using?
I guess you're problem is related to code access security.
|
|
|
|
|
it is not displaying any error. simply the window is went off. am using framework 2.0.
|
|
|
|
|
Hello.
I this txt file:
2
0 0 20 177 185 4
0 0 20 75 65 4
0 0 20 85 65 4
0 0 20 95 65 4
end
Where I divide the data into valid and unvalid lines
All the data is saved into an array
The valid data is:
0 0 20 177 185 4
0 0 20 75 65 4
0 0 20 85 65 4
0 0 20 95 65 4
And the unvalid data is:
2
end
I go through the array using two buttons:
Forward and previous
I have a int variable called currentLineNumber which contains the selected line from the array
When pressing forward the currentLineNumber is increased and decreased when pressing previous
My problem is that I need to enable and disable these two buttons on a certain point
For example if I am on the line
0 0 20 95 65 4
I want to disable the forward button since there is no valid data after that line
My question is:
How do I enable/disable these buttons when I reach the end of valid data?
Hope you understand otherwise just ask
|
|
|
|
|
Casper Hansen wrote: How do I enable/disable these buttons when I reach the end of valid data?
I guess you decide that, if you have no data to do it off, you have to define your own rules, surely ?
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 )
|
|
|
|
|
Yeah
I know how to do that, but the problem is that there can be some unvalid data and I dont know how to enable/disable if the data is unvalid
The text file is not the same all the time. The user can change it
So it could look like this:
2
0 0 20 177 185 4
0 0 20 75 65 4
0 0 20 85 65 4
0 0 20 95 65 4
0 0 20 15 65 4
0 0 20 55 65 4
0 0 20 91 65 4
end
Or this:
2
0 0 20 177 185 4
0 0 20 75 65 4
0 0 20 85 65 4
0 0 20 95 65 4
0 0 20 15 65 4
0 0 20 55 65 4
0 0 20 91 65 4
end
Or
2
0 0 20 91 65 4
end
If we take the last example the only valid data is 0 0 20 91 65 4 // (If any), so I want to disable the forward and previous button since there is no valid data to go to
I thought of an example where I looped the whole array and searched for a valid data, but couldn seem to figure it out
Here is how I read my text file:
while ((MonsterSetBaseLine = rds.ReadLine()) != null)
{
MonsterSetBaseDataArray.Add(MonsterSetBaseLine);
}
}
You might want to see this video:
http://youtube.com/watch?v=yLMDBRms-KU
You can see there are two buttons (forward and previous) where I go through the text file
So if the data is unvalid I skip it and go to the next valid data
Now if there is no valid data left in the text file I want to disable the forward button
Hope you understand my long post
|
|
|
|
|
linesLeft = currentLineNumber + 1;
for (int i = linesLeft; i < MonsterSetBaseDataArray.Count; i++)
{
checkIf(Convert.ToString(MonsterSetBaseDataArray[i]));
if (checkIfStatus == true)
{
break;
}
}
Here is what I got so far on my next / forward button
I thought of doing it like this:
If one of the remaining lines in the array is valid, the button will not be disabled, but if there is no valid lines left the button will be disabled.
I just couldn figure out the last part
Any ideas on this?
I know how to disable the button, but I dont know when to do it.
I disable my button like this:
nxtButton.Enabled = false;
Hope you can help, because im beginning to get desperate..
|
|
|
|
|
im working in a mail service application that send mails from a real mail server and a real email but when i test it i always receive it as a spam i want to receive it in inbox to ensure it will be checked.
Malak
|
|
|
|
|
You cannot control this in code. Your mail server is deciding this. Are you sending the same test email over and over ?
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 )
|
|
|
|
|
Your spam filter is obviously catching it.
What are you using to read your mail? Find out about what spam filters use to catch spam mail. They often use things like, "does return address match from address", "does message have subject line", etc etc. Work out what is missing in your email thats causing your spam filter to trigger.
Simon
|
|
|
|
|
hi
i want to write plugin for my app. i searched over internet and found many articles about this, but some is old and some is not good and full articles, can anyBody help me and get me a full practical article in .net 2.0 ?
thanks
|
|
|
|
|
You need to load dlls dynamically to use them as plug ins, so that the app works if the dll is not present. You obviously need to define an interface for adding a plug in, which the dll has to conform to.
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 )
|
|
|
|
|
thanks Christian Graus
yes, i know this, but i don't know how to do this by code (load assembly and use it at runTime). can u give me a full article ?
thanks.
|
|
|
|
|
.Net 2.0 is old these days.
.Net 3.5 has a new system.addin namespace which contains a whole bunch of stuff that makes writing plugins very easy.
Daniel Moth introduces it here[^]
and there are 2 good MSDN articles on it here[^] and here[^]
and there is at least one good article on CP by the awsome sacha barber here[^]
Simon
|
|
|
|
|
thanks Simon Stevens
i need in .Net 2.0, can u give me in .Net 2.0 ?
|
|
|
|
|
going back to the school i have an unanswered question...
why at all we need to define constructor explicitly when all the class has its own implicit constructor
what are the cons and pros if we dont define a constructor...
Thanks
Vikas
|
|
|
|
|
Defining a blank constructor obviously does nothing. Unless you define it as private, so it can't be used ( for example when you have one that takes params and want to force the user to call it). The ability to define one exists so you can add code to it, but the compiler won't barf if it looks like the one it generates anyhow.
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 )
|
|
|
|
|
First of all many thanks for your reply.....
I have one more question..
if am writing an application and not defining any constructor anywhere what are the possible impact on the application.
Thanks
Vikas
|
|
|
|
|
Absolutely zero.
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 )
|
|
|
|
|
IIRC, one impact that I'd experienced of is if it's a form (maybe apply to control even) and if you want to preview it on the designer, the designer will complain that it can't find the default constructor.
|
|
|
|
|
how can i make simple active x controlin C# and call it from javascript.
|
|
|
|
|
Wow Justin - Imagine meeting you here ?
I'd consider writing a .NET component that plugs into IE, why use ActiveX, when you're still going to need your users to download the .NET framework ? Or, use C++.
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 )
|
|
|
|
|
I have some knowledge of applying nunit for the methods that has the return value. Am getting difficulty in understanding how to write the code for testing the methods that does not return any value .
As the assertions takes two parameters, among them one is the expected object and the other is the actual. How to do this?
Please do reply...
|
|
|
|
|
Can you show your method ?
|
|
|
|
|
You can only test the public facing portion of the method.
Often methods that don't return anything are modifying something, like database state for example. Have NUnit check the state before and after the method is called to check that the results are as expected.
If the method really doesn't make any externally visible verifiable changes then there is nothing you can do, the method isn't testable beyond a simple "run to check it doesn't throw exceptions" type of test. This in itself is valuable, so still do this for a range of inputs.
Include Debug.Assert statements in the method itself to check inputs, mid point values and object states. (NUnit can be configured to treat debug assetions as test failures.)
Simon
|
|
|
|
|
I have some knowledge of applying nunit for the methods that has the return value. Am getting difficulty in understanding how to write the code for testing the methods that does not return any value .
As the assertions takes two parameters, among them one is the expected object and the other is the actual. How to do this?
Please do reply...
|
|
|
|