|
in that they have specified NTPClient what is it?
Is it a built in class or else created by the user.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Hi Every one ....
I want to develope a "windows application" with openfile dailog and save filedialog
in c#
Plz help me ...
Iam new to dotnet ...
help me with examples
Thanks inadvance
naresh.s.s
|
|
|
|
|
The classes are OpenFileDialog and SaveFileDialog.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
sssss
Ive done upto open dialog it will gies the path ...
but for the sae dialog am not getting the path there ....
and i cant able to save the file to desired forder ...
my code is .......
For Opendailog
OpenFileDialog fdlg = new OpenFileDialog();
SaveFileDialog dlg = new SaveFileDialog();
fdlg.Title = "Browse any file from here ";
fdlg.InitialDirectory = @"c:/Resume";
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fdlg.FileName;
}
for Savedailog
saveFileDialog1.Title = "Specify Destination Filename";
saveFileDialog1.Filter = "Text Files|*.txt";
saveFileDialog1.OverwritePrompt = true;
saveFileDialog1.FilterIndex = 1;
if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
{
textBox1.Text = saveFileDialog1.FileName;
}
this is wat ive done till now ...
but iam not gettign the path there at textbox1 when iam going to save the file ...
Plz help me .....
bye
naresh.s.s
|
|
|
|
|
1. Create a object for the dialog control (OpenFileDialog or SaveFileDialog)or use the controls
2. Then you open the dialog with ShowDialog() method
3. You can use Filter property to set the patterns to be displaye For e.g (Text Files|*.txt|All Files|*.*"
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
sssss
Ive done upto open dialog it will gies the path ...
but for the sae dialog am not getting the path there ....
and i cant able to save the file to desired forder ...
my code is .......
For Opendailog
OpenFileDialog fdlg = new OpenFileDialog();
SaveFileDialog dlg = new SaveFileDialog();
fdlg.Title = "Browse any file from here ";
fdlg.InitialDirectory = @"c:/Resume";
fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text = fdlg.FileName;
}
for Savedailog
saveFileDialog1.Title = "Specify Destination Filename";
saveFileDialog1.Filter = "Text Files|*.txt";
saveFileDialog1.OverwritePrompt = true;
saveFileDialog1.FilterIndex = 1;
if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
{
textBox1.Text = saveFileDialog1.FileName;
}
this is wat ive done till now ...
but iam not gettign the path there at textbox1 when iam going to save the file ...
Plz help me .....
bye
naresh.s.s
|
|
|
|
|
can you tell then what does it show??
One thing I found in your code is that... your code for declaring SaveDialog object is
SaveFileDialog dlg = new SaveFileDialog();
where you are using ..
saveFileDialog1.Title = "Specify Destination Filename";
saveFileDialog1.Filter = "Text Files|*.txt";
saveFileDialog1.OverwritePrompt = true;
saveFileDialog1.FilterIndex = 1;
if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
{
textBox1.Text = saveFileDialog1.FileName;
}
....
it seems you are also using another Object of SaveFileDialog, that you added in your form from toolbox (as naming convention suggest)...
|
|
|
|
|
you can get all those this from .net itself.
make use of the toolbox
My small attempt...
|
|
|
|
|
I have a file C#(window form),its name Server,I use method bind and listent of class socket,but after I turn off the dialogue,I turn on the task manager,I see it is running
Why ?
please help me
help me
|
|
|
|
|
Change the programe name and try again.Maybe you mix "Services.exe"(this is a windows process) as your program.
|
|
|
|
|
thanks for your answer,but actually,I know about Services.exe,I think it involed socket because when I run again,the program errored about the same port,IP
I haven't decided yet
help me
|
|
|
|
|
In the form_Closing Event write :
System.Environment.Exit(System.Environment.ExitCode);
|
|
|
|
|
|
You have probably left some threads hanging that you didn't tag as background threads or you instantiated a COM server that you didn't shutdown properly before your app tried to quit.
|
|
|
|
|
which method to do this
help me
|
|
|
|
|
sorry,maybe I found the answer
help me
|
|
|
|
|
you need to stop the thread you started by joining them and if you don't have threads, you should close the clients Client.Close();
|
|
|
|
|
In ASP.net,I can use mappath method to find my path exactly if it put in my application ,but Window form,I can't
Ex: in windodw form,I don't know use which method to find the path which I put in obj directory
help me
|
|
|
|
|
Just use:
AppDomain.CurrentDomain.BaseDirectory
please.
|
|
|
|
|
thanks about your answer,however my thought is not that;
I will give a Example
In windows Form if I put a Vunhat Named Created directory out directory debug and peer bin directory(or peer Debug directory)
I don't know how to find the files in VuNhat directory because
the default directory is actived is "......bin\\Debug\\"
help me
|
|
|
|
|
I ask permission to add ,If I use comannd File.Exist("Vunhat\\Hoang.txt"),the result is false
Hoang.txt is in the directory Vunhat and VuNhat peer Debug directory or peer bin directory
help me
|
|
|
|
|
use System.IO.Path.GetFullPath(file name);
|
|
|
|
|
[b]hey to all the forum
i create a tablelayoutpanel populated with label and pictureBox automaticlly loaded from a folder
and xml file
and i wanna know when the user select (click) on one of the picture or the label
and what's the coordinate of the selected cell
this is the code my tablelayoutpanel is named miniature[/b]
<code>imgSize = new Size(170, 170);
scanDirectory(folder, "*.jpg", System.IO.SearchOption.TopDirectoryOnly);
String selectedImage = selectedImg;
if (imgList == null)
return;
int a = 0;
miniature.ColumnCount = imgList.Length;
foreach (String img in imgList)
{
com_image.Text = com_image.Text + img + "\r\n";
l = new Label();
l.Text = img;
l.TextAlign = ContentAlignment.TopCenter;
miniature.Controls.Add(l, a, 2);
PictureBox pb = new PictureBox();
pb.Size = imgSize;
pb.SizeMode = PictureBoxSizeMode.Zoom;
pb.Image = Image.FromFile(img);
pb.BackColor = Color.White;
pb.Tag = img;
miniature.Controls.Add(pb, a, 0);
a++;
}
</code>
i tried miniature.GetCellPosition(); and miniature.PointToClient(new Point(e.X, e.Y));
but i don't know how to convert point to controls
thanks in advance
|
|
|
|
|
Off the top of my head, can you get the index of the selected cell's row? That might be better.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
i don't know but i dindn't find a fuction to give the selectedindex
but they must be function to give that
so if anyone can help
because i will give up
thanks
|
|
|
|