|
In order to do this, you are looking at licensing. There's a good explanation of it here[^].
|
|
|
|
|
A simple - but not very secure - method is to check the running application. If some code in your dll is called, and the running application is not your executable, throw some exception or let the application hang or randomly return wrong results...
Make sure you do not happen to hurt yourself when you use such methods.
|
|
|
|
|
1)We have developed a library to use it with our software & we build it as DLL
2)We developed a application using our library
Now what I need that no other user can use my library in his application for example when i give my application to end user that library is going to be added in setup, and if we dont protect it , any user can use it as reference in a .net project and can use my library and develop his own program , I need some thing that only my application will have access to my library and no other program can use it as reference and access its features
|
|
|
|
|
Hi All
I have a collection of pages where in each page I need to replace the reference of a control with some
other control....
Following is the line of code that I need to replace on every aspx page and there are about 90 + pages :
<%@ Register Src="../Application_Controls/Nonterm_Controls/CommonBookingEngineNonterm.ascx".
How can this be done programatically.Any help will be appreciated...
Thanks in Advance
Sumit
|
|
|
|
|
You wouldn't do this programatically - that would be complete overkill. All you you need do is a global find and replace in Visual Studio.
|
|
|
|
|
Hi,
Is it possible to download a file by passing it path to C# class library?
|
|
|
|
|
Sure. Why wouldn't it be?? Code is code. It doesn't matter if it's in a .DLL or an .EXE.
|
|
|
|
|
Ok but HttpResponse is not available in .cs files right? Can u please let me know whether am understanding it wrongly
|
|
|
|
|
Member 9617037 wrote: HttpResponse is not available in .cs Why not, it's just another .NET class? Or do you really mean HttpWebResponse [^]?
Use the best guess
|
|
|
|
|
Hey guys, dunno what I am doing wrong here... seems so simple.
Helper Class:
Class Paramaters
{
Public DateTime time = DateTime.Now;
public string formatDate = "MM/dd";
}
The Call:
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = Parameters.time.ToString(Parameters.formatDate);
}
Can anyone shed some light on what exactly I am doing wrong? Thank you.
|
|
|
|
|
taking a punt, since you dont say what error(s) you are getting ..
shouldnt Class Parameters and/or its members be 'public static' ? (else, iirc, you have to create an instance of it)
'g'
|
|
|
|
|
Wrong?? That would mean we need to know what you expected it to do. Whether it works right or wrong is relative to the expected result.
If you wanted the code to fail a certain way, well, then it would be working correctly, now wouldn't it?
|
|
|
|
|
LOL
I understand the concerns. What I have is a huge list of if statements associated with one of my buttons. They all will return this date in some way. Instead of having a million copies of the same code, I want to reference that class so when I change something within that class, it applies to all instances of the code.
The error I am getting is An object reference is require for non-static field, method, or property.
Copying the code
DateTime time = DateTime.Now;
string formatDate = "MM/dd";
textBox1.Text = time.ToString(formatDate);
In each and every if statement seems like it would be a big waste of code and space. I have about 20 buttons or so that would use it, each with 2 if statements attached. I want to just reference that code in a helper class and just have to type something like this:
textBox1.Text = Parameters.time.ToString(Parameters.formatDate);
which would return "03/11" in the text box, for today's date.
I hope this helps clarify my intentions, thanks.
|
|
|
|
|
If you want to use Parameters without creating an instance then the methods/properties/fields you are exposing need to be static. If they are all static, then the class should be static too.
You will have a problem with time if you make it static as it will only be set the first time you call it.
This will fix your problems:
public static class Paramaters
{
public const string MonthDayFormat = "MM/dd";
public static DateTime Time
{
get { return DateTime.Now; }
}
}
textBox1.Text = Paramaters.Time.ToString(Paramaters.MonthDayFormat);
|
|
|
|
|
Worked exactly as intended Dave! Thank you for clearing that up for me.
Time was a misleading description IN this case. However, this was also going to serve as my template for the time stamp portion of my next step.
How can I make Time (one that actually displays the current system time), dynamic? So if I push a button every 5 seconds, it updates the field I am pointing to to the current time?
Gosh not only do I sound like a noob, I am a babbling, confusing... noob.
Edit: Could I have it return my result into the box (or in my literal case, a log.txt file) and then turn around and reset that value?
|
|
|
|
|
No problem!
By using a property as in the code I posted, or using DateTime.Now each time directly rather than a cached field as you were attempting previously.
Edit: If you want to make it a little less wordy to access you could just create a static property or method that does it all for you:
public static class DateTimeHelpers
{
private const string MonthDayFormat = "MM/dd";
public static string NowMonthDayString
{
get { return DateTime.Now.ToString(MonthDayFormat); }
}
}
textBox1.Text = DateTimeHelpers.NowMonthDayString;
|
|
|
|
|
Sorry Dave, didn't realize you had already prevented that from becoming a problem. I just added another private const string to display hours and minutes how I desired, and it works flawlessly, you sir, are a gentleman and a scholar
|
|
|
|
|
You're welcome
|
|
|
|
|
Class Paramaters
Parameters.time.ToString(Parameters.formatDate);
And also
- or you should instintiate the Parameter class
- or make the members static.
I would also advice in using properties instead of members directly.
|
|
|
|
|
I'm still quite new the WCF Services
School assignments that I done on WCF were writing simple methods of WCF service which accepts strings or int or bool values.
However, I came across this wcf service that wasn't done by myself, and now I am required to write C# client to consume this service.
This WCF has a GetFees method which takes a Student Object as parameter (from WCF's Student DataContract)
See this image for how Student and Fee's datamembers
http://oi47.tinypic.com/wtgap3.jpg
My assignment is to Get Fees of particular students. The information i'm given are
StudentID=1, FirstName=Fernando, LastName=Gadd, Grade=4
StudentID=3, FirstName=Allan, LastName=Pascoe, Grade=1
Currently stuck on how to approach this question, but i'm thinking something like
Fee[] newFee1 = client.GetFees(new Student("1", "Fernando", "Gadd", "4".......
Fee[] newFee2 = client.GetFees(new Student("3", "Allan", "Pascoe", "1".......
Thank you whoever can help
|
|
|
|
|
hi all
i have 2 RFID readers that read active RFID tags ID within range, and i have written the code in c# and it works and reads the tags. each tag represents a device.
i have created a database on MS access provides information related to each tag, such as serial number, location, company,...
ISSUE: i need to insert the tag ID to the database and only update Location coloumn, AOTUMATICALLY. as long as the reader reads the tag the program has to update the location where the rest information will be as they are.
i have 2 readers (reader A & reader B) so that i have to compare the data coming from each reader in order to update the location. if reader A reads the tag ID and reader B doesn't >> location updated to Location A. while if reader B reads the tag ID and reader A doesn't >> location updated to Location B. and if neither of 2 readers read the tag the location will be (OUTBOARD). also if the readers read the tag ID at the same time ( readers range interfere), the location will be (mutual A&B).
readers are real time working, and i need to do the updating aotumatecally & continuously.
I really need help ASAP.
|
|
|
|
|
Basic process
1. Create (learn) how to do database insert and update. This does NOT have anything to do with the reader data. It is just basic knowledge.
2. Use 1 to create an API that creates/updates RFID data. This has NOTHING to do with getting the data.
3. Write code to read from a SINGLE reader and then call the API in 2.
4. Create (learn) two threads. Each thread calls 3. Maybe with a delay or maybe not. Depends on how you tell if the reader has data or not.
|
|
|
|
|
first of all, thank u for ur reply.
second:
1- somebody told me that there is library codes already created to do this purpose, is that true? and where can i find them?
2- i'm not a programmer, unfortunately, so that i really need more explanation.
3- if u don't mind we could communicate on skype or teamviwer,..etc, to discuss these steps.
4- if u mind, can u provide me the best and easiedt references on tutorials?
5- if u know someone is ready to solve my problem and programs it i'll be really thankful.
|
|
|
|
|
Eng.almasrouhi wrote: if u know someone is ready to solve my problem and programs it
You would need to hire a programmer to do this then. Highly unlikely that anyone is just going to do all of this for you for free.
|
|
|
|
|
actually, i'm looking for a programmer to hire. of course i'll pay him but i need to find one first.
|
|
|
|