|
I don't think anyone is going to get the idea because what you propose only does anything at compile time. It doesn't protect the app at all.
|
|
|
|
|
I see the app is not being built as a trial, but a dynamic trial based app.
...
|
|
|
|
|
First When U installed Your Software you must have to insert the Date any where either in Database or Text File or System Registry. When Person Start The Software Check That and +15 and Current Date Of System When Your Insert
Date+15=CurrentDate The Close That Software or any Message trial Period of your Software is Over. Application.Exit(),Application.ExitThread().
Thanku Dinesh
|
|
|
|
|
Hi,
I made one combobox which i canwrite some text, in C# and i build that as DLL.
And i call this to VC++.
My problem, when it is in C#,i can write text in combobox.
But in VC++,i cannot write.
When i press alphapets in keyboard nothing is displayed in combobox. only beep sound is coming.
Whats the mistake?
Anu
|
|
|
|
|
I have made this small application that can write and read XML and I am new to XML parsing.
The following source is probably pretty bad so does anyone have some ideas to make it better for example, a better design strategy for it?
I would really like to follow a good conduct before I look further
The main class (normal console application)
using System;
using System.Collections.Generic;
using System.Text;
namespace xml
{
class Program
{
static void Main(string[] args)
{
List<Product> list = new List<Product>()
{
new Product(0, "Xbox 360", ProductType.Electronic, 129.99m),
new Product(1,"Playstation 3",ProductType.Electronic,130.99m),
new Product(2,"Playmobile Tonka",ProductType.Toy,29.99m),
new Product(3,"Tennis rack",ProductType.Sports,50.99m)
};
XmlRules rules = new XmlRules();
rules.SortList(ref list, SortType.IDLowest);
Xml xml = new Xml();
xml.SaveProductAsXML(list);
xml.ReadXml();
list = null;
}
}
public class Product
{
public int ID { get; set; }
public string Name { get; set; }
public ProductType Type { get; set; }
public decimal Cost { get; set; }
public Product(int id, string name, ProductType type, decimal cost)
{
ID = id;
Name = name;
Type = type;
Cost = cost;
}
}
public enum ProductType
{
Electronic, Toy, Sports
}
}
An XML class that deals with saving and reading XML:
using System;
using System.IO;
using System.Collections.Generic;
using System.Xml;
namespace xml
{
class Xml
{
const string _FILE_NAME = "products.xml";
public void SaveProductAsXML(List<Product> list)
{
XmlDocument root = new XmlDocument();
XmlElement rootElement = root.CreateElement("Products");
root.AppendChild(rootElement);
for (int i = 0; i < list.Count; i++)
{
XmlElement elemnt = root.CreateElement("Product");
XmlAttribute att = root.CreateAttribute("Name");
att.Value = list[i].Name;
elemnt.Attributes.Append(att);
XmlAttribute idAttr = root.CreateAttribute("ID");
idAttr.Value = list[i].ID.ToString();
elemnt.Attributes.Append(idAttr);
XmlAttribute typeAttr = root.CreateAttribute("Type");
typeAttr.Value = list[i].Type.ToString();
elemnt.Attributes.Append(typeAttr);
XmlAttribute priceAttr = root.CreateAttribute("Price");
priceAttr.Value = string.Format("{0}", list[i].Cost);
elemnt.Attributes.Append(priceAttr);
rootElement.AppendChild(elemnt);
}
root.Save(_FILE_NAME);
root = null;
rootElement = null;
}
public void ReadXml()
{
using (FileStream file = File.OpenRead(_FILE_NAME))
{
XmlDocument document = new XmlDocument();
document.Load(file);
XmlNodeList nodeList = document.GetElementsByTagName("Product");
for (int i = 0; i < nodeList.Count; i++)
{
string name = nodeList[i].Attributes[0].InnerText;
string id = nodeList[i].Attributes[1].InnerText;
string type = nodeList[i].Attributes[2].InnerText;
string price = string.Format("{0:c}", decimal.Parse(nodeList[i].Attributes[3].InnerText));
Console.WriteLine("Name {0}", name);
Console.WriteLine("ID {0}", id);
Console.WriteLine("Type {0}", type);
Console.WriteLine("Price {0}", price);
Console.WriteLine();
}
}
Console.ReadKey();
}
}
}
And finally a class that stores the sorting rules for the XML document:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace xml
{
class XmlRules
{
public void SortList(ref List<Product> list, SortType sort)
{
IEnumerable<Product> products;
if (sort == SortType.PriceLowest || sort == SortType.PriceHighest)
{
products =
from p in list
orderby (sort == SortType.PriceHighest ? p.Cost * -1 : p.Cost)
select p;
list = products.ToList();
}
else if (sort == SortType.IDLowest || sort == SortType.IDHighest)
{
products =
from p in list
orderby (sort == SortType.IDHighest ? p.ID * -1 : p.ID)
select p;
list = products.ToList();
}
products = null;
}
}
public enum SortType
{
PriceLowest, PriceHighest, IDLowest, IDHighest
}
}
Thanks!
|
|
|
|
|
If it works, I'd leave it alone and move on into the rest of the project.
Beyond that, I would make the method in XmlRules static so that you don't have to instantiate the class to use that method. (By the way, you neglected to take into account the sort direction.)
Second, I would use Linq-to_Xml to load/save the XML data from the disk file. It's much simpler.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I have developed a windows app that will run on a local network. I have the app set so users can run the app from the server. What do I need to do so the user doesn't get the message: "The publisher could not be verified. Are you sure you want to run this software"
Thanks in advance!
sk
|
|
|
|
|
Digital Signature -- see here: http://www.kinook.com/blog/?p=10[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I assume you are using IE 7 or 8. Add your app to the browser's trusted sites list.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
The Solution that i Provided U is For Win App.
1)First U Have to installed Your application on Server and The Folder Which is Created on Your Server Must Be Shared with Full Permission on That Folder.
2)Go To The Start->Run->Cmd->cd \->CD Windows (Enter)
CD \Microsoft .NET FramreWork 2.0 (Enter)
CD \Framework (Enter)
CD \v2.0.50727 (Enter)
C:\Windows\Microsoft .NET FramreWork 2.0\Framework \v2.0.50727(this you path)
after that you have to Write The command
caspol -cg 1.2 FullTrust (Case Senstitive)
Ask For Yes Or No Press Y
All This Work is Done At Server.
Now on Client
1)First Installed .NEt FrameWork 2.0 Setup
2)MYComputer Right Click MAP Driver From That Server on Your Client Computer
3)Repate The Setup Of Command on the Client as Above
|
|
|
|
|
Happy New Year ! to all.
Just wondering if someone would give me a bit of guidance on this.
I need to signal various points of code execution from a windows service to a monitoring application on the same machine.
This is apart from those handled by "Service controller class".
I have had a look at tcp sockets, .net remoting and named pipes, but that all seems like overkill.
As i am simply looking for a boolean flag, no messages or data transfer as such.
Has anyone found a simple way of doing this,i know i must be missing something ?
Thanks in advance.
|
|
|
|
|
IPC generally isn't a simple thing. If you want to signal state from one process to another then you have to send some sort of message but it doesn't have to be a big one.
Two simpler options than the ones you listed are shared file IO (see the System.IO[^] namespace) and MSMQ (see the MessageQueue[^] class). If you want quick and easy, I suggest you look into the MSMQ option; it boils down to just a few lines of code for both sending and receiving messages.
|
|
|
|
|
Thanks for that, i will investigate the message queue alternative i think.
I had thought about using an XML file but it seems like that could introduce possible problems.
It is reliability i am after.
|
|
|
|
|
Hi,
I'm experimenting with the new System.Threading.Parallel methods like parallel for and foreach.
They seem to work nicely but I need a way to increase the number of concurrent threads that are executed which are 8 (I have a quad core).
I know there is a way I just can find the right property.
Gilad.
P.S. Please don't write that more threads won't give better output, I already have got a bunch of those.
|
|
|
|
|
Well, I believe (but don't quote me on that), that you can create a new TaskManager and give it a parameter maxConcurrentThreads (or such)
Is that what you're looking for?
-- edited to not be an answer --
modified on Friday, January 1, 2010 6:30 PM
|
|
|
|
|
Well... this is kinda tricky..
in the System.Threading 2008CTP you could see the TaskManager and it actually had properties for Threads-Per-Cpu under
System.Threading.Tasks.TaskManager.Current.Policy.IdealThreadsPerProcessor
but for some reason it wasn't possible see the default taskManager nor to access those values (read-only) or create a TaskManager of your own.
In the 2010 beta there is no TaskManager... hmmm... I couldn't find any similar object that might do the same job.
What is going on???
|
|
|
|
|
Aaah breaking API changes! They do not make me happy.
I'm sorry, but I really have no clue then..
|
|
|
|
|
You can use an overload that takes a ParallelOptions parameter and set its MaxDegreeOfParallelism property. However, the default TaskScheduler uses the thread pool to decide the number of running threads, so you're not really in control.
If you use Tasks instead, you can pass TaskCreationOptions.LongRunning , which spawns a new thread every time.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
quote:
var query = from item in source.AsParallel().WithDegreeOfParallelism(10)
where Compute(item) > 42
select item;
In cases where a query is performing a significant amount of non-compute-bound work such as File I/O, it might be beneficial to specify a degree of parallelism greater than the number of cores on the machine.
from:
MSDN[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
hi I'm trying to code a telnet server in c# i know how to create simple shell by redirecting stdin,stdout over a socket but I would like to be able get the user to log in using a username and password how would i do this, i know i could do this by before the cmd.exe is executed i could ask user for username and password and then execute the shell but is there a better way to do this?
|
|
|
|
|
Please read the forum guide line before you ask any question in forum.
Your question is nothing related with asp.net
[Edit] I am sorry. I thought I am replying in ASP.NET Forum [/Edit]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
modified on Saturday, January 2, 2010 3:28 AM
|
|
|
|
|
Abhijit Jana wrote:
Your question is nothing related with asp.net
Sorry... Not an ASP.NET
|
|
|
|
|
I am sorry !! I thought I am replying in ASP.NET forum
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi so can anyone get back to me on this question?
|
|
|
|
|