|
You can either store it in the Registry, probably under the CurrentUser key, or in a file somewhere.
But, keep in mind, this is considered a mild security risk. You might also want to include an option to turn this feature on/off.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want the button handeller "btnOpen_Click" to open a spacefic folder has this path (D:\MyFolder) what can i do ?
thanks in advance .
misho
|
|
|
|
|
You can browse the documentation for OpenFileDialog[^] and use the InitialDirectory property.
mav
|
|
|
|
|
Hi,
Can someone please tell me where I can find a Step-by-Step guide to building a Forum Discussion Board?
Thanks!
Illegal Operation
WannaBe and GonnaBe Systems Developer
|
|
|
|
|
http://www.codeproject.com/asp/codeproject-forum.asp[^]
This is a description of the CP forums ,and also microsoft has released a free code for its community in a web site named communityserver but i really don't remember the URL if you googled it you will of course find it,and its in C# .
|
|
|
|
|
Hi,
i'm trying to develop a C# windows service that needs to expose procedures and functions that will be called remotely via an application that is going to be developed in delphi 6.
i'm totally new to distributed applications, so if anyone can give me some guidance as to how i can accomplish this, i will be VERY greatfull.
Thanks a million!
Afzal Hassen
|
|
|
|
|
hi all,
I want to write a C# Application to Uninstall Applications(Exes)?
Can any one guide me?
thanks in advance..
|
|
|
|
|
|
hi,
Yes..it is in the "add/Remove programs" in the Control Panel.But I want to uninstall it from Start-->Programs--->ABC-->uninstall ABC
Menues..
How do we get Uninstall Program for above Menue.?
Thanks in advance..
|
|
|
|
|
Hi!
You could simply call msiexec to uninstall your application:
msiexec /uninstall MySetup.msi
There are commandline parameters to make it a silent (un)install and several others.
You can find the documentation here: MSIEXEC docu on MSDN[^]
Regards,
mav
|
|
|
|
|
I am attemping to bind the data from an xml file into a datagridview. I have achieved this via the following code:
<br />
quotesDataSet.ReadXml(Properties.Settings.Default.XmlQuoteFile);<br />
<br />
quoteGrid.DataSource = quotesDataSet;<br />
quoteGrid.DataMember = "quote";<br />
This automatically binds the four elements of the quote parent into four rows. However, from that point on, I cannot rename the header rows or control them in any way. I've tried everything from attempting to assign a datagridtablestyle, to simply using quoteGrid.Columns[1].HeaderText = "Text"; Can anyone provide me with a working example of how to achieve this?
|
|
|
|
|
I think it makes sense that you can not change the header because you are directly linking the xml file to the datagrid. To change the header you need to create custom columns using DataGridTextBoxColumn classes (example follows). Another option you might have is to read the xml into a dataset and modify the table with your data so it has a different column name.
Example for custom table:
Instead of setting Datasource, use the following:
<br />
this.dataGrid1.SetDataBinding(myDataSet, "MyTable");<br />
CreateCustomTable();<br />
</code<br />
<br />
<code><br />
private void CreateCustomTable()<br />
{<br />
DataGridTableStyle ts1 = new DataGridTableStyle();<br />
ts1.MappingName = "Department"; <br />
ts1.AlternatingBackColor = Color.LightGray;<br />
<br />
DataGridColumnStyle TextCol = new DataGridTextBoxColumn();<br />
TextCol.MappingName = "Name";<br />
TextCol.HeaderText = "Department Name";<br />
TextCol.Width = this.dataGrid1.Size.Width-60;<br />
ts1.GridColumnStyles.Add(TextCol);<br />
<br />
this.dataGrid1.TableStyles.Add(ts1);<br />
}<br />
<br />
|
|
|
|
|
I'm working with the new Visual C# Express beta and the latest of the .Net 2 version. Unfortunately, they have replaced datagrid with datagridview, and datagridtablestyle does not seem to have a new version. Unfortunately, they also have not provided any documentation that I can understand for achieving the same effects. Any other thoughts?
Thanks for the help either way.
|
|
|
|
|
In that case instead of quoteGrid.Columns[1].HeaderText
try yourDataGridView.Columns[1].Name="your column name" .
I hope that helps, I really haven't tried the new version yet.
|
|
|
|
|
Its determined to stay with the fields in the dataset, so I tried your second suggestion from the original and renamed the fields in the dataset temporarily. This worked on the datagridview just fine, many thanks!
|
|
|
|
|
How to add a ComboBox into a datagrid
Thanks
|
|
|
|
|
|
Same as the title says, is there a simple way to do this?
If not, how do i do it anyway (if its too much trouble i'll just carry on using .wav files
|
|
|
|
|
At the top of this page there is a search box.
Enter "play midi", and you'll find a few articles about playing midi.
_________________________________
Please inform me about my English mistakes, I still try to learn your language!
|
|
|
|
|
You can also drop a windows media player control in your form. Ofcourse this will enable you to do much more than just play midi files.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
I tried to use TcpClient to send xml file to server...
But somehow my data get mess up, why is this so?
The resulting data is not in the same format that the data is sent
<sending side="">
TextReader infoReader = new StreamReader("SystemInfo.xml");
string info = infoReader.ReadToEnd();
Byte[] data = System.Text.Encoding.ASCII.GetBytes(info);
ns.Write(data, 0, info.Length);
<receiving side="">
using (StreamWriter sw = File.AppendText("clientInf.xml"))
{
string str = "";
byte[ ] buffer = new byte[1024] ;
while(ns.DataAvailable)
{
ns.Read ( buffer, 0, buffer.Length ) ;
str += Encoding.ASCII.GetString ( buffer ) ;
}
sw.WriteLine(str);
sw.Close();
}
|
|
|
|
|
Is it necessary for you to decode and encode the string to a byte array and back? You can simply wrap ns in a StreamWriter and write the string itself. At the other end, you can wrap ns using a StreamReader and simply call ReadToEnd() . And don't forget to Flush the writer after you're done.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I don't really get it, do you mind showing me how to do it in coding? Well I didn't think about encoding though, I just thought that when transfering through socket, infomation needed to be converted to byte form... isn't it so?
Thank you,
|
|
|
|
|
Something like this
TextReader infoReader = new StreamReader("SystemInfo.xml");
string info = infoReader.ReadToEnd();
StreamWriter writer = new StreamWriter(ns);
writer.Write(info);
writer.Flush();
using (StreamWriter sw = File.AppendText("clientInf.xml"))
{
StreamReader reader = new StreamReader(ns);
string str = reader.ReadToEnd();
sw.WriteLine(str);
sw.Close();
}
I guess the .NET functions use the default encoding scheme to send and receive data. What you might have missed is Flush .
What exactly are you receiving?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Can this method handle multiple client?
I mean like if the client are sending at the same time.. will the data get mixed up ? Well, I am making a service to inpect client hardware specf and then display it back on the website. It is for my internship project though.
Thanks a lot, will try it out tomorrow ..
|
|
|
|