|
Thanks for the info.
i solved it by embedding the standard dtd/ent files into my lib and made my xmlresolver use the embedded resources if they exist otherwise it will use the external resources.
//Roger
|
|
|
|
|
Good idea! I hadn't thought of doing that off the top of my head.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How to write a application that the user can only use 3 times.
I'm waiting for you.
Thank you.
|
|
|
|
|
Maybe you shoud make a config file and also store some counter values in registry. On load your program should increment value in registry and if it's > 3 then your application should delete your file.
xedom developers team
|
|
|
|
|
Alex Getman (leTaon) wrote:
then your application should delete your file
Bad practice to delete from a user's PC without notification or prior notification that after # uses the app will delete itself.
Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
|
|
|
|
|
Weak. Very weak. There is nothing to stop the user from unstalling the app, deleting the registry keys and files you leave behind and then starting all over again. Or even just put the older values back into the registry and files.
Copy protection like this is nortoriously difficult to write. Google for "time limited software protection" and you'll come up with a bunch of results on libraries and packages that can be used in your project.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The only way of associating a file with a FileStream object is thru its constructor, It means if I want to change the file name associated with some FileStream , I should re-instantiate it, doesn't it? Do you know any better way to do that?
Regards
I lock my house, I lock my car and I pull that zipper on my pants up several times a day for the sake of security.
|
|
|
|
|
A FileStream is tied to a native file handle, so yes, you must reinstantiate it. This is also why you should call Dispose on the FileStream when you're done. The file handle is a native type and unmanaged. Calling dispose closes that file handle. If you don't call Dispose , the file may remain locked until your application is closed.
Changing the file to which a FileStream object reference is not supported because of this fact. You can reassign the variable to a new FileStream , but that would reference a different object (and if you didn't call Dispose before changing the reference, you've just lost the ability to dispose it so that the native file handle is released).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I define a class based on UserControl
UserControl has no Image property ,I add one like this
public class mycontrol : System.Windows.Forms.UserControl
...
private Image m_image;
...
public Image Image
{
get
{
return m_image;
}
set
{
m_image = value;
}
}
I putted it into visual studio toolbox,In design time ,I load a picture , but Can't unload it and set it back to none.
for example , a button has the image property , if I want get this image out , just set the property to "" in property grid,then the button's Image change to none,how does it works?
it's my image property define wrong ?
|
|
|
|
|
Set the Image to null, that works for me (Try it with a button, asign an Image and add a click event that sets the Image property to null, the Image will disappear). If not, try calling the control's Invalidate() or Refresh() fucntions, since those will force the COntrol to repaint itself.
|
|
|
|
|
The Image class itself is attributed with the ImageConverter , which takes care of this automatically for you. There's nothing you really need to do. You could attribute your property with [DefaultValue(null)] , which will allow you to right-click and select "Reset".
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks you, That's just what I want.
|
|
|
|
|
hi
i want send mail from my program to next email ,for example Anzerato@hotmail.com ,but i can't,and error is :
System.web.HttpExeption:could not access 'CDO.Message'object.--->System.Reflection.TargetInvocationException:Exception has been thrown by the target of an invoction.--->System.Runtime.InteropServices.COMException(0x80040213):the transport failed to connect to server.
.
.
.
my program is :
MailMessage mail = new MailMessage();<br />
mail.From = "alichangizi@Hotmail.com";<br />
mail.To = "Anzerato@hotmail.com";<br />
mail.Subject = "Site Error";<br />
mail.Body = "OK";<br />
mail.BodyFormat = MailFormat.Html;<br />
MailMessage();<br />
try<br />
{<br />
SmtpMail.SmtpServer = "localhost";<br />
SmtpMail.Send(mail);<br />
}<br />
catch(System.Web.HttpException ehttp)<br />
{<br />
Console.WriteLine("{0}", ehttp.Message);<br />
Console.WriteLine("Here is the full error message output");<br />
Console.Write("{0}", ehttp.ToString());<br />
}<br />
|
|
|
|
|
For one, you need to have the CDO component installed. The easiest way on Windows 2000, XP, and Windows Server 2003 is to install the SMTP services. Also, the SMTP server must relay for a particular domain. In your case, you must relay for hotmail.com.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I was wondering if you can set a hidden value (would this be called a SelectedValue?) to each row in ListView? I'm populating the ListView from a DataSet. I want to be able to click on a row and have a form come up and ask for edit/delete this row (which would really update the DataSet and then reload the ListView to show the changes). Of course in order to do this, I need to have a corresponding ID for each row in the ListView that's retrievable from the selected row.
Thanks,
Ron
|
|
|
|
|
I faced with this problem not so long... Well, I created a hashtable and set keys from 0 to ListView.Count, and values were set just like in ListView, and on_klick I looked through hashtable and delete item that I need.
xedom developers team
|
|
|
|
|
Hi Ron,
Each ListViewItem has a Tag property which can be used for storing anything you need. In your case you could associate an ID or a datarow object with it.
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Thanks Serge!
Works great!
Ron
|
|
|
|
|
I created two forms: MainForm has a textbox tbBox1. I clicked a button btnOpen to open the second form (named Form2). Now I want to get or set the value of tbBox1 from the second form by clicking a button btnAccess. How can I do it? The MainForm was opened by the standard "Application.Run(Form MainForm);" and the second form was opened by "Form2 a = new Form2(); a.Show();" in btnAccess's OnClick event. I have made tbBox1 public but I couldn't access the instance of MainForm. The MainForm class' instance (an object) has no name when opened from Application.Run. Please help.
|
|
|
|
|
1. in form2, declare a member System.Windows.Forms.Form pForm;
2. overload the Form2's constructor
public Form2(System.windows.Forms.Form aForm)
{
pForm = aForm;
}
now you can acess Form1 like this.
pForm.xxxButton.Text = "test";
try it.
nhi
|
|
|
|
|
of course,when you create Form2 in form1 ,you should pass itself to the form2's contructor like
Form2 frm = new Form2(this);
frm.Show;
nhi
|
|
|
|
|
Make a function in your second form that takes a Form1 object as a parameter. Then pass "this" as the parameter from the first form
Form2 a = new Form2();
a.myFunction(this);
...
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Thank you all. I got it work now. I declared the textbox in MainForm as public so that Form2 can get to it. Thanks again.
|
|
|
|
|
Right now I'm writing a wallpaper changing application to run in the systray. The application works great. The app went together really quickly and easily using the .NET framework. However, since it is a systray app.... I want it to be as small as possible in memory.
Just running the app (not even connecting to the web or working with GDI+ for imaging) it sits at about 12M in memory with 5M virtual memory. This is the release version of the code.
Is there anything I can do to reduce the footprint? I liked the speed of development, but I don't know if it is worth almost 20M in memory.
Thanks,
Dave
|
|
|
|
|
Take a look at System.Diagnostics.Process.MaxWorkingSet and MinWorkingSet properties.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|