|
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; }
|
|
|
|
|
MasterSharp,
Is this image static?, eg do you ever need to change it?
If not, just use a picture box and load the image that way.
Also, Whats the error?
Regards,
Gareth
|
|
|
|
|
It's not static, but I don't really intend to change it. Do I have to use a picturebox? Can I just load it anywhere (I have multiple images with the for loop later...)
- I love D-flat!
|
|
|
|
|
You load an image file using Image.FromFile() or Image.FromStream().
The former locks the file until the image gets disposed of.
You can also embed an image as a resource, and load it from there when needed.
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.
|
|
|
|
|
I still get the error.
- I love D-flat!
|
|
|
|
|
What error? Please try to provide good information if you want to get good replies.
use a try-catch construct, catch the Exception, and look at Exception.ToString().
It will show a message, extra details, and a stack traceback. The first class.method
with a linenumber is the source line you should look at.
I hope you told Visual Editor to always display line numbers? (menu Tools/Options/
TextEditor...).
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.
|
|
|
|
|
I know ehere it is. It's when I set the Bitmap previously declared to be a new Bitmap with a file extension. The error: ArgumentException was unhandled. Parameter is not valid.
- I love D-flat!
|
|
|
|
|
MasterSharp wrote: a new Bitmap with a file extension
there is no such thing as a bitmap with a file extension, only files have an extension.
I'm guessing you are doing something like new Bitmap(filespec+".JPG")
and it throws the ArgumentException, so you must:
1. look at the exact value of the parameter you have there; is it a valid path?
2. if relative path is used, is the current directory at that point what you expect?
3. check that file exists
4. check that file contains a valid image (does it show a thumbnail in Windows Explorer).
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.
|
|
|
|
|
Do I need te file extension or not? (jpg, png ... ?)
- I love D-flat!
|
|
|
|
|
This is it:
Btimap myBitmap;<br />
<br />
public Form1<br />
{<br />
<br />
myBitmap = new Bitmap("Content/Sprites/myImage.jpg");<br />
<br />
}
It doesn't work, when the file is under those folders in the explorer, WITH that name.
- I love D-flat!
|
|
|
|
|
That is not the correct path. When visual studio builds it places your executable in the bin directory. ../../Content/Sprites/myImage.jpg might work but the easiest thing to do is change your project settings to move the images to the bin directory on compile.
However, I usually set the options to embed in the assemble and the use the GetManifestResourceStream method from the Assembly class to retrieve the streams at runtime.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
So the suspicious things are under my earlier points
1. are slashes valid folder separators on your system?
2. this is a relative path, is curdir what you think it is?
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.
|
|
|
|
|
A file extension is not mandatory; AFAIK GDI+ recognizes the image formats it supports
without needing the extension for that, so the only thing that matters is the filespec
correctly points to an existing and valid file.
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,
I am trying to deploy an application accompanied by a .chm help file. The file is referenced in the app by a helpProvider object that has a directory path property for the .chm.
Publishing the app is straight forward using the 'Click Once' publish wizard provided with 2005 Express. Unfortunately, when installed on the target computer, the app will only link to the .chm file if it has been placed (manually) in a directory that has exactly the same path as it had on the developer computer. The publish wizard seems to ignore the presence of the .chm file completely.
How do I publish the app so that the .chm file is included with it and installed automatically on the target computer?
A related 'problem' is that I cannot find the app on the target after it has been installed; the 'Program Files' directory does not appear to be used. Where does the app reside when it is installed on the target?
Thanks in advance JR.
|
|
|
|
|
Hi everyone,
Can someone tell me what is the cheapest way to send SMS through a C# application???
i will be thankful if u can give me some suggestion or links.
kind regards,
Nadia
|
|
|
|
|
Nadia v D,
What do you mean by "cheapest" way?, As in money? or...
Regards,
Gareth
|
|
|
|