|
What details... There are several methods for separate parts of the app.config...
Create a reference to System.Configuration and see the System.ConfigurationManager
Please vote my message! Click on one of the numbers beside ' Rate this message'.
.: I love it when a plan comes together :.
http://www.zonderpunt.nl
|
|
|
|
|
I am going to hold the port number in a tag which i am going to create.
I can have my own tag in it know.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Yep, use the appSettings section for that...
Create a new entry
<add key="PortNumber" value="123">
in your code, use System.Configuration.ConfigurationManager.AppSettings["PortNumber"] to retrieve the setting value.
Please vote my message! Click on one of the numbers beside ' Rate this message'.
.: I love it when a plan comes together :.
http://www.zonderpunt.nl
|
|
|
|
|
Thank you.
I have done the same.
-- modified at 5:23 Wednesday 19th September, 2007
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
The following is the section in the app.config:
<code><pre><?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
.....
</configSections>
<applicationSettings>
.....
</applicationSettings>
<!-- Holds the information related to remote communication-->
<RemoteCommunicationSettings>
<add key="PortNumber" value="1011"></add>
</RemoteCommunicationSettings>
<Modules>
.....
</configuration></pre></code>
When I am accessing this using the following code:
<code>
NameValueCollection remoteCommnSettings =
ConfigurationManager.GetSection("RemoteCommunicationSettings") as NameValueCollection;
NameValueCollection section = ConfigurationManager.GetSection("Modules") as NameValueCollection;
</code>
For the "RemoteCommunicationSettings" it is giving null
but for "Modules" it is giving the values.
Can you give me a suggestion.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
You completely ignored the advice you got.
The config section you added isn't valid. You should have paid attention to the sqiggly line under your RemoteConnectionSettings tag. That means what you typed isn't valid.
The code you posted won't work for retrieving your config section because you didn't add the section to the app.config properly.
Go back to the advice you were given and just add the port number to the applicationSettings section.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="PortNumber" value="1011" />
</appSettings>
</configuration>
|
|
|
|
|
Hi All,
I have one WebForm(.aspx) I m using this page for showing the reports. In that page there are two(2) DataGrid and 5 Labels.All Data is coming dynamically.There is one Button.
On click of that Button, I m sending mail of this Webform into PDF format . Now i dnt know how to convert my aspx Webform to PDF. Is there any inbuilt class into .net 1.1???? Plz give me detail coding.
Plz help me. I m searching this thing from many days.
Thank you................
|
|
|
|
|
vhs17 wrote: Now i dnt know how to convert my aspx Webform to PDF
There is no conversion.
vhs17 wrote: there any inbuilt class into .net 1.1????
No, there isn't. Not even in .NET 2.0, 3.0, or 3.5.
I'd recommend using another app running on the web server, or another server, that takes a URL to get that page, with all the data it needs, then either uses a third-party library or a "PDF Printer" to assemble a PDF file for that image, then emails that PDF file.
vhs17 wrote: Plz give me detail coding.
Noone is going to write the code for you. This is something you have to write the code for, and when you get stuck, you can ask specific questions about it.
|
|
|
|
|
DirectShow filters are moreoften refered to as a Codec. However, codec stands for CoderDecoder of filter is mostly used for decoding. That's why DirectShow calls those a 'Filter'. Now when opening a Media file, DirectShow will automaticly use the correct filters (for example when opening a .mp3 file) to decode the .mp3 and play the sound.
Now when you're not satisfied with the 'automaticly' generated list of filters, you can tell DirectShow to use certain filters. This is however quite complicated. You can use the GraphEdit[^] program to open a media file and insert filters to test of the filters you want to use work.
Please vote my message! Click on one of the numbers beside ' Rate this message'.
.: I love it when a plan comes together :.
http://www.zonderpunt.nl
|
|
|
|
|
How can i read the current path of a file? I want to run an exe file in differnt folders to read the elements. For this how can i read the current path of the xml file.
|
|
|
|
|
Your question is not clear - what is "current path of XML file"? Are you saying you have a relative path to an XML file but need the absolute path? System.IO.Path.GetFullPath() will do that for you.
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
Is there a way to control the content in one webBrowser control from another webBrowser control in a different window? I want to have HTML in one, then by clicking, or doing something in there, control or modify, or whatever, the content in the other window's webBrowser control. I would assume that the content being controlled would need to be in an owned window...
Any thoughts?
Thanks...
|
|
|
|
|
Dudez,
I have a datagridview, when I click search button,
it will show the data on the datagrid. I have no problem on this. The problem is, I want to generate the search data into a CSV File. When I click generate button and it should generate csv file. How to do that?
Any suggestions/feedback/comments are appreciated.
Thanks,
C#Coudou
******************************
I just want to
know everything
|
|
|
|
|
|
Excellent!!!
Thanks stathread
******************************
I just want to
know everything
|
|
|
|
|
hi
i want to use usb, to control devices such as on/off some LEDs, how to do ?
thanks
|
|
|
|
|
You can't connect an LED to the USB port and control it's on/off state from code without custom hardware. You're going to have to do your own research on this one. Here's a head start[^].
This is NOT just whip together a few lines of code. There are entire articles and chapters of books written on this subject. I think you're going to need a book just to understand how USB works, because from the sound of your question, you don't have a clue what USB really is.
|
|
|
|
|
Hi All,
I am creating an application that takes a sample every 10 ms in C#. Well I am using the Windows forms timer and its not accurate at all. Does anyone have a timer they can suggest that is more accurate? Please let me know of the timer and how to program it.
Thanks,
Laura
|
|
|
|
|
Laura - have a read through this[^] article by Luc. It might offer you the help you want.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
It's been a long time with no coding done. I need to read an MDB file pull out the "getname" then read a directory and compare the name in getname to the file names in a directory. If it's a match then move the file to another directory if it does not match move it to a different directory.
Any ideas on error handling and where or not I should use a temp directory to move the files to first just in case additional files are written to the directory from the host system.
Thanks to all
|
|
|
|
|
The DirectoryInfo class and the FileInfo class should be all you need for the file side.
DirectoryInfo dir = new DirectoryInfo(@"c:\");
FileInfo[] fileList = dir.GetFiles("*.*");
Now fileList array has a snapshot of all the files found on c:\. You can change the file filter to be whatever type of file you want. The GetFiles() method has an overload that takes an additional parameter called SearchOption that can be used to include subdirectories if you want.
FileInfo[] fileList = dir.GetFiles("*.*", SearchOptions.AllDirectories);
Once you have that snapshot, you don't care about new files added to the directory, because you'll be iterating the fileList array and the Excel doc. Hope that helps you and shows you how to avoided moving files to a temp directory when it's not needed.
|
|
|
|
|
Thanks, I'll start with that.
|
|
|
|
|
I am writing an Excel program using C# to populate each worksheet with data from a remote machine in my workbook. Depending on the name of the worksheet I need to connect to the different servers to gather the LUN(disk size info) information. The LUN information is too complicated to gather using SQL. Also, the vendor doesn't want to supply me with the SQL script. The vendor had supplied the HSMDiskStatus.exe that can gather these information. The HSMDiskStatus.exe can be execute with the following switches:
HSDDiskStatus.exe /f e:\DPSan_Chart\" + servername + ".txt"
the /f switch tell the executable where to save the txt file.
I am using the Process class to do this but I am not having any luck. I either get "parameter is invalid" or the "specified can't be found." Is there a way to check if you are connected to the remote server using Process class during debug?
thank you very much,
Donjuanwu
Below is my code:
private void ConnectToDataServer(string servername)
{
try
{
//server and directory when connect
string execPath = @"\\" + servername + @"\E:datacenter\";
string filePath = execPath + "HSMDiskStatus.exe";
string password = "password";
Process proc = new Process();
//******don't know if Proc.StartInfo.Arguments is where I need to set the switches to execute the
********HSMDiskStatus.exe
proc.StartInfo.Arguments = " " + @"/F e:\DPSanChart\" + servername + ".txt";
//switches to include when executing HSMDiskStatus.exe
string cmdLine = @"/F e:\DPSanChart\" + servername + ".txt";
proc.StartInfo.Domain = servername;
proc.StartInfo.FileName = filePath;
proc.StartInfo.UserName = @"domain\username";
System.Security.SecureString secret = new System.Security.SecureString();
foreach (char c in password)
{
secret.AppendChar(c);
}
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.Password = secret;
proc.StartInfo.WorkingDirectory = execPath;
//*********I can't inclue any arguments in Proc.Start(). I have to use
***********System.Diagnostics.Process.Start()
System.Diagnostics.Process.Start("HSMDiskStatus.exe " + cmdLine);
//proc.Start();
while (!proc.HasExited)
{
proc.Refresh();
}
proc.Close();
}
catch (Exception ex)
{
throw ex;
}
}
|
|
|
|
|
Put the arguments in the System.Diagnostics.ProcessStartInfo's Arguments property.
-- modified at 17:06 Tuesday 18th September, 2007
On further review, you can provide the arguments as the second parameter to System.Diagnostics.Process.Start(string,string)
-- modified at 17:08 Tuesday 18th September, 2007
|
|
|
|