|
Hi Luc,
while debugging i have checked the following
check the value of baseDir;
it comes with right path
does it end on a backslash?
yes it end with \\
does the folder exist?
yes the folder exist and it none but the base directory of my code path
can you create a file there?
yes files created there when running in debug or release mode
but when ever i am making an exe and installing it to another system files are not created.vikas da
|
|
|
|
|
You could try:
Application.StartupPath
The only difference is in the "\" so
Application.StartupPath => "C:\Data\Blah"
and
AppDomain.CurrentDomain.BaseDirectory => "C:\Data\Blah\"
As for the AppDomain.CurrentDomain.RelativeSearchPath :
if you do not create it specifically in code something like this:
domain.AppendPrivatePath("MyCustomAssembly");
it will return empty string.
|
|
|
|
|
tasumisra wrote: ,so for this i have written a class
Why reinvent the wheel? There are plenty good frameworks for this already like, Enterprise Library, whose pupose is to create a library of common tasks to save developers from having to recreate it each time. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I open and hide form using form.showdialog() and form.hide();
How do i detect if the current form is hidden, and if it's hidden don't do this.modified on Sunday, February 7, 2010 8:41 AM
|
|
|
|
|
To hide the form use the Form.Hide method. To show it again use Form.Show
Simple, no?If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
hey OriginalGriff,
Tks for the reply. i have edited my question to make it more clear.
I open and hide my form using form.show and form.hide
how do i check if the current form is hidden so as not to perform certain task
|
|
|
|
|
The property form.Visible determines whether a form is visible (shown).Greetings - Jacek
|
|
|
|
|
Great. It works. tks Jacek
|
|
|
|
|
you can put global bool var. and when you hide the form put it True else false
(it is just an idea)
|
|
|
|
|
Tks. alternative idea for visible method.
|
|
|
|
|
this how i hide a form and open a new one
Form1 form = new Form1();
this.Visible = false;
if(form.ShowDialog() == DialogResult.OK)
{
}
this.Visible = true; / on close of the form you opened the one you started from shows
|
|
|
|
|
Dear Experts!
I am using xml in my project to store a list of objects of different types derived from the same base object.
[XmlArray("parts"), XmlArrayItem("part", typeof(Cpart))]
public ArrayList parts;
This approach works only if all objects are of the same type.
Can it be dome with objects of different types in the array?
Thanks!modified on Tuesday, February 9, 2010 4:43 AM
|
|
|
|
|
I want to fill a combobox with System.Windows.Forms.Keys Emun!
So how can i do that?
|
|
|
|
|
You can fill combo box like this
comboBox1.DataSource = Enum.GetNames(typeof(System.Windows.Forms.Keys));-----------------------------
Shakeel Iqbal
------------------------------
My New Article
Task Manager
|
|
|
|
|
Hi,
What's the equivalent of final keyword(Java) in C# ?
Thanks.
|
|
|
|
|
From the subclassing point of view, use the sealed keyword.
If you talking about declaring a final instance variable in Java, use the const or readonly keyword in C#.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
|
I am building a GUI for a UART to communicate to a MC and then to a I/O expander. Right now I have the data going thru the RTS and DTS and my switches monitored by CTS DSR DCD and RI. How could I change this to be implemented to use only TX and RX for all of this without having to start all over. I am not real great with programming but I do know enough to understand. I have included the piece of code that I use for this part.
#region Initialization
public enum LEDColor { RedOn, RedOff, GreenOn, GreenOff }
private bool RTSState = false;
private bool DTRState = false;
private bool RingIndicator = false;
public Form1()
{
InitializeComponent();
pictureBoxRTS.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
pictureBoxDTR.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
pictureBoxCTS.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
pictureBoxDSR.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
pictureBoxDCD.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
pictureBoxRI.BackgroundImage = imageList1.Images[(int)LEDColor.RedOff];
}
#endregion
#region Modem lines
private void serialPort1_PinChanged(object sender, System.IO.Ports.SerialPinChangedEventArgs e)
{
if (e.EventType == SerialPinChange.Ring) RingIndicator = !RingIndicator;
showCTS_DSR_CD();
}
private void showCTS_DSR_CD()
{
if (serialPort1.IsOpen)
{
if (serialPort1.CtsHolding) this.pictureBoxCTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
else this.pictureBoxCTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
if (serialPort1.DsrHolding) this.pictureBoxDSR.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
else this.pictureBoxDSR.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
if (serialPort1.CDHolding) this.pictureBoxDCD.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
else this.pictureBoxDCD.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
if (RingIndicator) this.pictureBoxRI.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
else this.pictureBoxRI.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
}
else MessageBox.Show("Error in showCTS_DSR_CD - serailPort1 not open.");
}
#endregion
#region Buttons
private void buttonRTS_Click_1(object sender, EventArgs e)
{
RTSState = !RTSState;
if (RTSState)
{
serialPort1.RtsEnable = true;
pictureBoxRTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
}
else
{
serialPort1.RtsEnable = false;
this.pictureBoxRTS.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
}
}
private void buttonDTR_Click_1(object sender, EventArgs e)
{
DTRState = !DTRState;
if (DTRState)
{
serialPort1.DtrEnable = true;
pictureBoxDTR.BackgroundImage = this.imageList1.Images[(int)LEDColor.GreenOn];
}
else
{
serialPort1.DtrEnable = false;
this.pictureBoxDTR.BackgroundImage = this.imageList1.Images[(int)LEDColor.RedOn];
}
}
private void buttonCheck_Click_1(object sender, EventArgs e)
{
showCTS_DSR_CD();
}
#endregion
|
|
|
|
|
|
sallam
iam iran
mikhastam bebinam kasi hast ke betone mano komak kone
man miham ke barname benevisam ke vaghti ejra besh betone tamam adade dubel
jabeja kone masalan 3/4 convert 4/3
ba estefade az barname c#
|
|
|
|
|
Please post your questions/queries with proper language so that the other can read and give you feedback as well. Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
نیتروژن مایع
Translation here.[^]
Please post in English, most people speak that here, and you'll get an answer more quickly....Cpianism: I have a negative number in my Rep so please fix it.
Chris Maunder: That isn't a bug.
|
|
|
|
|
wait.. hwo did Liquid Nitrogen get into the equation?Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel] | FoldWithUs! | sighist | µLaunch - program launcher for server core and hyper-v server
|
|
|
|
|
hi
who can you help
languech c#
i function whil can 3/4 dobel 4/3 convert
|
|
|
|
|
Read a book on C#; I am sure there are versions in Arabic and/or Farsi. MVP 2010 - are they mad?
|
|
|
|