|
There is an article about self-installing windows service on codeproject. Find it and it will help you
|
|
|
|
|
Hi all,
Im trying to list all the System DSN Names. How can this be done in C#??
Please help.
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
The DSNs are stored in the registry on WinXP at [ HKLM -> Software -> ODBC -> ODBC.INI -> ODBC Data Sources ]. I'd imagine other Windows OSs would store them somewhere similar if not the same.
|
|
|
|
|
Hi,
I want to know version of installed driver of any device on remote machine.
Is there any method to get version information of Device.
Thanks in advance.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi,
Kindly let me know that, My compiled application is placed on "C:\ABC\GOOD.EXE"
after executing said application file, how may I get "C:\ABC" directory/folder name?
Thank you
|
|
|
|
|
You get the directory with:
AppDomain.CurrentDomain.BaseDirectory
Greetings
|
|
|
|
|
To find out the directory where your application is located use Application.StartupPath
To find out current working directory of the application use Directory.GetCurrentDirectory() method
|
|
|
|
|
Hi,
i've got kind of a strange problem :
this is the Code :
<br />
<br />
rtbMsg.Text += Msg_Err;<br />
int pos = rtbMsg.Find(Msg_Err, RichTextBoxFinds.MatchCase);<br />
rtbMsg.SelectionFont = new Font(rtbMsg.Font.FontFamily, rtbMsg.Font.Size, FontStyle.Bold);<br />
rtbMsg.SelectionStart = pos;<br />
rtbMsg.SelectionLength = Msg_Err.Length;<br />
rtbMsg.SelectionColor = Color.Red;<br />
<br />
the problem is that the app "Stucks" because of this section of the code
this code is a part of a function that is called to update Messages for the user
the error messages comes in tcp/ip analyzed and if the message is an Error message it's displayed
and the color of the message should be red (Selection...)
when i remove this code every thing works but the Error message looks just like Ordinary Messages
This is funny
Where did i went wrong?
THANKS
Have Fun
Never forget it
modified on Thursday, January 17, 2008 2:50:21 AM
|
|
|
|
|
Hi,
I don't see where this piece of code would "stuck" your app, unless it is inside
a loop, or an event handler connected to the rtbMsg control it manipulates.
I do have some comments:
1. the Find() is probably unnecessary, if you want to find the text you have just
appended, why not take the length of rtb.Text before you append?
2. AFAIK setting a new SelectionFont before anything got selected does not achieve
much
3. the new Font(...) stuff keeps creating new fonts, which seems
unnecessary; maybe just create it once and keep a reference to it?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Yeh U a right
first of all : ihave two default font (rFont, bFont)
i wrote this method to be general :
is it Better?
<br />
<br />
private void ChangeRTB_Text(RichTextBox rtb, string strToWrite, Color cText, Font fnt)<br />
{<br />
rtb.Text += strToWrite;<br />
rtb.SelectedText = strToWrite;<br />
rtb.SelectionFont = fnt;<br />
rtb.SelectionColor = cText;<br />
i've Tried This Also :<br />
/*int pos = rtb.Text.Length;<br />
rtb.Text += strToWrite;<br />
rtb.SelectionStart = pos;<br />
rtb.SelectionLength = strToWrite.Length;<br />
rtb.SelectionFont = fnt <br />
rtb.SelectionColor = cText;*/<br />
}<br />
the IMPORTANT thing is that there is a Thread That Recive Messages (TCP/IP)
and when it identifyed a Message That sholud be an Error
it Sends by an Event To The form, There (in the Form) Comes the :
<br />
<br />
ChangeRTB_Text(rtbmsg, Msg, Color.Red, bFont); OR<br />
ChangeRTB_Text(rtbmsg, Msg, Color.Green, rFont);<br />
<br />
THNKS ANYWAY
Have Fun
Never forget it
|
|
|
|
|
Hi,
a Control (such as a RichTextBox) should only be accessed by the thread that created it
(normally thats the main or "GUI thread") since Controls are not thread-safe.
Violating this rule often results in GUI hang-ups or CrossThread violation exceptions
(new since .NET 2.0, can be disabled, bad idea tho).
The only good solution is by using a pattern based on Control.InvokeRequired and
Control.Invoke and a delegate; you can google for these, and/or look at a small example
at the end of my Sokoban article.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi friends,how can i send free sms ffrom my C# web application?.Thank you in advance.
Hi,Im Razana
modified on Thursday, January 17, 2008 12:41:46 AM
|
|
|
|
|
you need a third party services
|
|
|
|
|
Hai i working on some project were i have four different classes when i enter the text in textbox based on that it is read to the that class and it is to be added to generic list how can i work on this can any help me in this
|
|
|
|
|
Your question isn't very clear. Do you mean something like this?
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace MyApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MyTextClass TestClass = new MyTextClass(textBox1.Text);
MyTextCollection TestCollection = new MyTextCollection();
TestCollection.Add(TestClass);
//Do other stuff here...
}
}
class MyTextClass
{
private string _Text;
public string Text
{
get { return _Text; }
set { _Text = value; }
}
public MyTextClass()
{ }
public MyTextClass(string Text)
{
_Text = Text;
}
}
class MyTextCollection : List<MyTextClass>
{
}
}
<div class="ForumMod">modified on Thursday, January 17, 2008 9:14:52 AM</div>
|
|
|
|
|
yes my problem is similar to the above one were i have four different classes and in the window from were i have text boxes if I enter the data based on that data type i need to add the remaining items to that class and to generic list but in main problem is they r nor high lighting when i write the program under the window from can u pls help me
RamyaNaidu
|
|
|
|
|
when the program be ran again, set main window(the program has ran already) top.
if the main window was hide, show it.
if it was not hide,I achieve it.
but if it was hide, I do not konw how to show it.
modified on Wednesday, January 16, 2008 11:58:02 PM
|
|
|
|
|
I created a address book and I've noticed that it is very slow! I mean even when the database is empty the program takes a while to open. When you add pictures, it is even slower. I know it is probably because it is just using the picture you select (no matter waht size it is) and resizing (stretch) to make it fit in the picturebox I have. Now is there a way to speed the whole program up? Or is there a way to have a loading screen appear and preload the database and pictures (something that specifies what it is current loading). I would rather just speed up the database. If you know of an article I could read that would help me with this, or maybe if it is easy to just tell me then i would appreciate it!
|
|
|
|
|
Hello, I want to create a method for encrypting HTML code (may be Javascript based encryption). Can you give me any suggession or guideline ? Any free algorithm available for this ? or any .NET Class library ?
Example : my method can be like this,
string getEncryptedHTML(string plainHTML)
and it would return code like this :
<script language=javascript>s="a3Ca73~70B61B6EF20c6Fa6Ec63D6Fa6ED74a65~78a74B6D-65c6E.75c3DF22~72.65c74a75c72D6EB20~66B61D6Ca73~65B3B.22-20D6F~6E~64
|
|
|
|
|
|
Hi,
thanks for your help. Actually the links you provided gives me the idea about Encryption and Decryption. That means, I can encrypt a text but I need C# Again to decrypt the text. But my intention is to generate Encrypted HTML Text as a Javascript which will be decoded and displayed by Internet Explorer and other browsers.
|
|
|
|
|
It is a wasted effort. The code to decrypt would reside in the Javascript which would be easily stealable allowing a proficient user to steal the code anyway. The best bet is to use Ajax to populate the DOM which makes it more difficult to view the full source since many browser may not show the full source after a DOM operation, at least not yet.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Hello. I know I shouldn't come for such a simple problem, but I don't understand how to load an image. It was easy XNA, but regulaly is ...hard? I have an image file in the solution explorer under folders "Content" and "Sprites". Say the image is myImage. Whenever I declare a bitmap and then try to load in the public Form1 method, it always gives me an error. How do I load this image. (Does it matter the type of file?) Thanks in advance.
- I love D-flat! if (!iWin) { iWin = true; }
|
|
|
|