|
Hello again,
does anyone know how I would save a file using this path "%userprofile%" I've tried numerous ways but can't do it. I'm trying to save a file in a users home directory on Windows 2000
Thanks again.
- monrobot13
|
|
|
|
|
String szuserprofilevar = "%userprofile%";
String szuserprofile = Environment.ExpandEnvironmentVariables(szuserprofilevar);
|
|
|
|
|
Thanks for the help.
- monrobot13
|
|
|
|
|
i need a webpage show source code to draw element model (artifacts) like Rose or Visio adn by C#. Please give me.
Thanks
|
|
|
|
|
A full fledged Windows Form app can run inside IE6, inside a web page. Now you need to find (or better, write it on your own) a Windows Forms which does draws object models. My suggestion is to look around gotdotnet.com samples, sourceforge,....
|
|
|
|
|
I need to change the local IP and local computer name in my C# app. I can set the IP using the ManagementObject, but I have not found a way to change the computer name.
-- Kevin
|
|
|
|
|
Hi All,
I'm having a problem that I hope will be simple to solve. I have a RichTextBox that I don't want to format text. By this I mean if I copy a piece of text that is say bold and italic when I paste it into the RTB I don't want it to have those characteristics (unless the Font specified for the RTB has them). For an example lets say that font in my RTB is 8pt and I copy something that is 14pt when it's pasted it gets pasted at 14pt, I don't want that. Is there any way to get around this?
Thanks
- monrobot13
|
|
|
|
|
Figured it out. Just had to use a plain text (DataFormats.Text) format in the Paste method.
Thanks
- monrobot13
|
|
|
|
|
I have a DataGrid in my windows app. One of the fields is a date time type. It's showing up at a date in my DataGrid. I really need to see the time too. How can I change the format of this one field in the DataGrid?
|
|
|
|
|
To change the format of a column, you need to set the Format property of the DataGridTextBoxColumn corresponding to the column. See the example code under DataGridTextBoxColumn should help.
Burt Harris
|
|
|
|
|
Thanks you for your reply.
In my application I'm trying to display records in a table that let me know that some services I have written are working. At this point I'm updating the display on a button click. I tried to apply the code I found in the example you pointed me to. You can see the error message from my exception trap. Can you tell me where I when wrong?
private void m_btnUpdate_Click(object sender, System.EventArgs e)
{
this.sqlDataAdapter1.Fill(this.imAliveDataSet1,0,0,"ImAlive");
// Gets the DataGridTextBoxColumn from the DataGrid control.
DataGridTextBoxColumn myTextBoxColumn;
myTextBoxColumn = null;
// Assumes the Time column is a DataGridTextBoxColumn.
try
{
myTextBoxColumn = (DataGridTextBoxColumn)dataGrid1.
TableStyles["ImAlive"].GridColumnStyles["Time"];
}
catch (Exception excpt)
{
string strMsg = string.Format("{0} Exception caught.", excpt);
}
// Gets the DataGridTextBox for the column.
DataGridTextBox myGridTextBox;
myGridTextBox = (DataGridTextBox) myTextBoxColumn.TextBox;
strMsg "System.NullReferenceException: Object reference not set to an instance of an object.
at FordMon.Form1.m_btnUpdate_Click(Object sender, EventArgs e) in c:\source\ford\fordmon\fordmon\form1.cs:line 227 Exception caught." string
|
|
|
|
|
Is there an method or a way of preforming a SQL SELECT statement on a DataTable so that it returns a array of Rows?
The DataTable.Select() method won't do the job as my query is a bit too complex for me to use it.
This is my SQL query:
SELECT COUNTY_ID , NAME
FROM TOWNS
WHERE NAME IN
( SELECT NAME FROM TOWNS
GROUP BY NAME HAVING COUNT(*) > 1);
Do I need to use a SQLDataAdapter or something? Just a guideline on how I should go about doing this would be helpful.
Thanks
|
|
|
|
|
While a data set has some of the features of a relational database, it's not got a full SQL interpreter, so DataTable.Select won't do what you're looking for. If your data is in SQL database, you can issue the query with a SQLDataAdapter as you suggest.
Hope that helps.
Burt Harris
|
|
|
|
|
Hi,
I was wondering if it is possible to program a low level network application in .net. I mean I want to choose the network interface that handles the packets sent from my app, I want to get every IP packet that passes thru my computer, and so on...
Can anyone give me any pointers?
Thanks a lot,
Andrei Matei
andreimatei@home.ro
|
|
|
|
|
How can I to determine when socket connected to my TcpClient is close connection?
I do this...
IPAddress ipAddress = Dns.Resolve(Dns.GetHostName()).AddressList[0];<br />
TCPListiner = new TcpListener(ipAddress,PortNumber); <br />
TCPListiner.Start();<br />
<br />
while(true)<br />
{<br />
if (TCPListiner.Pending()) <br />
{<br />
TcpClient TCPClient = TCPListiner.AcceptTcpClient();<br />
NetworkStream LNS = TCPClient.GetStream();<br />
}<br />
}
then I send some text throw NetworkStream LNS. Client can close connection. And result this....
System.IO.IOException: Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, So
cketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32
size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32
size)
|
|
|
|
|
Hi All!!
i want to to create crystal report at run time and set all its properties like texts,sections etc. but i am not getting the way to get in. it has many classes like
ReportObject
ReportClass
ReportDefinition
ReportDocumnet
but this is confusting that how to take start...
i want to do like this (this is just assumption)
CrystalReport report = new CrystalReport();<br />
Section section = new Section();<br />
report.Secctions.Add(section);
can anyone help??
sorry for my bad English.
|
|
|
|
|
Hi, I have a problem with drag and drop: every sample about it i have found shows only how to drag a text from a textbox to another or a listview/treeview item to another. Instead, I have some controls (some shapes) and i need to allow to the user to drag them over the form like the visual studio IDE, with the resizing handles, the drawing of the dragged control's border, etc... exactly how the IDE! Can anyone help me, showing some samples (in vb.net or c#)?
|
|
|
|
|
May be a good starting point[^].
|
|
|
|
|
Ok, so I have this app that you fill in your subject and then the message and then it formats it in the particular way i told it to, onto my webserver as a .xml file....
XmlTextWriter writer = new XmlTextWriter("poofacedjohn.xml", null);
But, what I need is for the name of the xml file not to be poofacedjohn.xml, but rather the year, month, day, hour, and minute of the local machine...
like.....
20030426_1718.xml
2003 04 26 17 18
|year||month||day|_|hour||minute|
how would I acheive this...? I can do it in asp.net, but it's not working for me as just a regular windows app.
/\ |_ E X E GG
|
|
|
|
|
String szfilename = System.DateTime.Now.ToString("yyyyMMdd_HHmm") + ".xml";
|
|
|
|
|
My C# app has a RichTextBox which is using a right-click context menu. How can I add icons next to the text in the menu?
I found a few places that said they had add-ins to do this, but I'd rather just understand how it works to do it myself.
Can anybody explain it, or point to a resource which explains it?
Thanks.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Windows Forms (at least in .NET 1.0) does not allow that. You'll need to use a library such as Lutz Roeder's CommandBar for .NET[^].
Cheers,
Arun
|
|
|
|
|
How can I access MySQL from C# without using stuff that I have to configure outside of my program? (The tutorials I see require me to configure ODBC for example)
I want to be able to just enter the address in my program and connect to it, but I see no easy functions like mysql_connect() or so...
|
|
|
|
|
SourceForge.net has a project that is developing a managed MySql provider.
|
|
|
|
|
I've looked everywhere to try and find out how to print decent images.
I've used a few programs which seem to be programmed in Delphi, and have asked the programmers if they do anything special when loading or printing and the answer is NO.
So why can't I get the same quality printing when using C#, the images are the right size from the start, so I just shove them into the printpage and fire them out to the printer.
The program is for printing CD covers, and the text etc is just not sharp.
Can anyone Please help, I'm a newbie and at a total loss at where to loko next.
|
|
|
|