|
This code will only work if you're using a Zebra printer that understands these codes. It's not going to work for every thermal printer in existance.
Your best source of information on the code you send to the printer is the documentation on your printer, not someone elses code.
|
|
|
|
|
As much as i can remember you have a Zebra designer software comes with zebra printer driver CD. You can design your barcode using that software and also you can export that in a text format(ie the way you are printing).
also you have all documents (comes in a folder) how to print the barcode in that CD itself.
I think reading those documents will help you.
|
|
|
|
|
Hi,
In my desktop app developed in VB.NET, I want to send an email.
Private Sub CreateMessage()
Dim from As New MailAddress(fromTxt.Text.Trim, nameTxt.Text.Trim)
Dim toAdd As New MailAddress(toTxt.Text, totitle)
Dim msg As New MailMessage(from, toAdd)
msg.Subject = subjectTxt.Text.Trim
msg.Body = messageTxt.Text.Trim
Dim cc1 As New MailAddress(cc1.Text)
Dim cc2 As New MailAddress(cc2.Text)
msg.CC.Add(cc1)
msg.CC.Add(cc2)
Dim client As New SmtpClient()
Try
client.Send(msg)
ToolStripStatusLabel1.Text = "Message Sent Successfully"
Catch ex As Exception
ToolStripStatusLabel1.Text = "Error Sending Mail"
MessageBox.Show("Error sending mail : " & ex.ToString, "ERROR :: Try Again", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
cc1 = Nothing
cc2 = Nothing
from = Nothing
toAdd = Nothing
msg = Nothing
client = Nothing
End Try
Return
End Sub
Above is the code I use to send email. I have imported System.Net.Mail & set MailMessage object properly also created SmtpClient. But I don't know what and how to set the Smtp host. I mean, the app will be on differnet PC's & all will be using different means of Internet access. Then how can I know and set the host before sending message. I tried adding "localhost" but that didn't worked. What to do and how to achieve the goal ?
This should be possible and in a simpler manner - when I can do the same in my Java apps then why not in .NET apps. Searched a lot on net also, but every example showed "<your server="" name="">", but how can I know the server name of each PC ???
Any help guidance is highly appreciated.
Thanks & Regards,
|
|
|
|
|
|
Oh Thanks Dave for this.
Just wanted to confirm a point and make myself understand properly.
So a mail will have From & To. From will be someone who is writing & To will be my mail address (I will receive it). If my mail address i.e. To is of hotmail, then I got to implement of Live Mail, if of Yahoo then of Yahoo & if of gmail then of gmail. Then regardless of what the From address belong. If To is "...@hotmail.com" & From is "...@xyz.com" ; If I implement of Live Mail, then I will receive all mails send from anyone.
Am I correct or wrong at any angle. Kindly let me know.
Thanks & Regards,
|
|
|
|
|
From Address is the person sending, To address is the receiver, in this case you.
The SMTP server needs to be any server for which the user who is sending the email is authorised to use. It doesn't matter who the target (TO) address is, it is dependant on who the sender is.
SMTP servers generally need to be authorised, as there are very few open relays now due to the abundance of spam and abuse they receive.
|
|
|
|
|
Thanks Dave, I found my way and also solved the confussion.
But am just wondering 1 thing. In my form I already have ToolStripProgressBar. When the Send(mail) is being executed, for a short while I see 2 progress bars. Then 1 disappears. Can't find what is going on. Does Send() shows a progress bar by default - didn't find any such info in MSDN.
Can you tell what must be the reason of seeing 2 progress bar for a short while when Smtp.Send(mailMessage) function is being executed.
In MSDN I also found that when send is eecutes, it blocks so its safe to set timeout. Can you tell what value should be set in timeout - 100000 (100 secs) is good enough or should be more !
Thanks a lot.
Thanks & Regards,
|
|
|
|
|
Thats good to here.
your welcome.
|
|
|
|
|
When I run my application I am initializing some boolean flags - all of them are set to false at the begining, then just before the Load function ends - I am enabling another windows form full of buttons which are meant to be changing the flag statuses depending on which button the user presses. So when user presses the button on the second form - it run the function which is supossed to change flag status on the first form and after that it closses second form.
The thing is, that the flag status is not being changed, so if I want to set this flag status to true, it's all the time false. I don't know why. Below is the example code:
// declaration of values
private bool isFirstActive;
private bool isSecondActive;
private bool isThirdActive;
//splash screen form
private SplashScreen splashScreen;
//second menu form
private SecondMenu secondForm;
// initialization in constructor
public MainForm()
{
//show the splash screen to the user while loading
splashScreen = new SplashScreen();
splashScreen.Owner = this;
splashScreen.Show();
Application.DoEvents();
this.Enabled = false;
InitializeComponent();
isFirstActive = false;
isSecondActive = false;
isThirdActive = false;
}
private void MainForm_Load(object sender, EventArgs e)
{
//enable the main form
this.Enabled = true;
this.Visible = true;
//close the splash screen
splashScreen.Close();
//enable the second form
secondForm = new FacultyMenu();
secondForm.Owner = this;
secondForm.ShowDialog();
}
So now the user will see second form with some buttons, below the code for the second form with example button click:
private MainForm firstForm;
public SecondMenu()
{
firstForm = new MainForm();
InitializeComponent();
}
private void btnChangeSecond_Click(object sender, EventArgs e)
{
firstForm.changeSecondFlag();
Close();
}
So when user press the button, it will call the following method on the first form:
public void changeSecond()
{
isFirstActive = false;
isSecondActive = true;
isThirdActive = false;
}
Then it's closing the second form and goes back to the main form. but the isSecondActive valuse is still false.
Why?
|
|
|
|
|
acont wrote: So when user press the button, it will call the following method on the first form:
No, it will call a method on an object that has the class-type as defined for the class "MainForm". There's two of those objects; one that's your actual mainform, and that you use to open the second form, and then there's a new object of the same type, created in the SecondMenu method.
acont wrote: Then it's closing the second form and goes back to the main form. but the isSecondActive valuse is still false.
It's closing the second form, and the mainform contained therein (in the private variable firstForm). Then it goes back to the original mainform. The boolean is set in the second instance, the original object isn't changed.
How about passing a reference to your mainform in the constructor of the second form? You could cache a reference to that instance, changing things on that would correctly change the original object.
I are Troll
|
|
|
|
|
forget about this forum to get any help; its useless
|
|
|
|
|
|
imak wrote: Its not a repost
Then add the extra information to your original question, do not delete it and start a new thread.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote:
Then add the extra information to your original question, do not delete it and start a new thread.
just read the information provided to get that extra info
|
|
|
|
|
No your asking us to do your work for you.
D@nish gave you a perfectly valid answer: it is possible.
You can't expect people here to just write the code for you, we all donate our time for free here. If you want somebody else to write your program then go and hire yourself a programmer and pay him.
If you want our help you'll have to proof to us that you at the very least tried to do it yourself (so post you code and where your stuck or have an error).
|
|
|
|
|
imak wrote: Is it doable via refelction?
Yes it is. But it will be quite bad considering application performance.
imak wrote: If so can you please post some example code?
Well, you should try yourself first and then ask with specific details. That is what the guidelines say.
|
|
|
|
|
Hello Friends,
I have developed a desktop software with VB.NET. I want to create some security measurements through which, after purchasing one copy, customer cannot copy to several computers or distribute freely. Their may be customers who may need the product to be run on N number of machines independently (not on Network). In that case also, the customerId may be same but each machine must have independent copy of the product.
How can I achieve such security measurements for newly developed desktop software?
Any helpline, guidance is highly appreciated.
Thanks & Regards,
modified on Friday, September 3, 2010 9:16 AM
|
|
|
|
|
I can think of two ways of doing it.
1. Have a product key and validate it on your server. You can keep the IP and the key to be sure your software has been installed. This will require the users to have internet connection at least while installation.
2. I am not sure how this can be done, but here's the thought. If you can get the details of the computer where your application is installed in the setup some how while installation, next time when the same setup is used, it can prompt that the S/W has already been installed on another computer.
|
|
|
|
|
d@nish wrote: 1. Have a product key and validate it on your server. You can keep the IP and the key to be sure your software has been installed. This will require the users to have internet connection at least while installation.
Can you tell how does this product key option works. I feel the logic & flow should be such as :
1 User is installing
2 While installation it talks to a other app lying on the Server.
3 The server app, keeps the IP address, checks in another DB lying at server.
4 If the IP address is new, provides a Product key and stores the same against the IP on the DB located at Server.
5 If IP address is not new, displays appropriate message and doesn't allow to install the app.
Can you confirm with the above logic. And also if possible provide any code for me as help to proceed.
REG 2nd Point - what kind of computer details can be retrieved and checked out. Any clue.
Thanks & Regards,
|
|
|
|
|
For the first approach, you can use following logic:
1. Provide a key along with the setup. When the user enters that, pick up the IP address* and send them both to server.
2. Server should then check in the DB that the sent product key is already registered with some other IP*.
3. If yes, and IP* is same, let the user install and if IP* is different, deny installation.
*Many people have dynamic IPs and hence this logic looks flawed. You can get the Mac address since it is a unique number for each computer. Although, if the end user has tried Mac spoofing ie changing Mac address, there might be some problems. Still this IMHO will be a bit more secure way.
For approach two, Mac address can be a number you can track.
Since I have never implemented anything like this I cannot provide code sample right away. Although googling something like "product registration" might give useful results.
|
|
|
|
|
All Time Programming wrote: I want to create some security measurements through which, after purchasing one copy, customer cannot copy to several computers or distribute freely.
Some things to consider;
- Can I still reinstall Windows, or would I have to purchase a new version?
- What happens if I buy a new PC? Can I keep the software, or do I have to purchase a new version?
- Reading what you wrote, it implies I am allowed to install it on a single server and use some remote-desktop software to share it with some friends?
- For IP: will the software continue to work if I switch my internet-provider?
- Are you loosing money on those illegal copies, and how much of your precious time is it worth?
I are Troll
|
|
|
|
|
I have never done this as I tend to write web applications, but, I have heard of people doing the following with a good success rate.
When the user installs the application the must activate it, much like Windows now does. On activation, the software gathers certain information about the computer, some examples are processor id, memory id, motherboard manufacturer, ect. You grab this info and smash it together into say a string and that is not the computers unique ID. You also send the user a key that you generate. When the program trys to activate you check first that the generated key hasn't been used, if it has, check that the unique ID matches.
There is one flaw to this type of validation. If the user upgrades that computer, they will get a new processor id, or memory id, ect (depending on what they upgrade of course). There are solutions to this issue as well but I'll leave that all up to you.
Hope that helps, if you need some more help on this I have thought about this fairly heavily and maybe be able to provide more suggestions.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Thanks to All of you for these good suggestions and hints. At present, I have managed to work out with unique Serial Key with the product managing algorithm of my own. Customer downloads from net or anywhere without this he want be able to install only & without installation, it wont run only. Lets see ahead what is required and how.
Once again Thanks to all. If I need any further assistance in this matter, will definetely ask you guys again. Your ideas heled me bring up something differnet but safe.
Thanks
Thanks & Regards,
|
|
|
|
|
hi,
can someone tell me how to change the color of a part of a string in a cell from a datagridview.
for example
if the text of a cell is "125/art"
how can i show the "art" in red color ?
i know, i can use the Richtextbox but i dont want to change the color of the complete text.
thanks for your help
jogi
|
|
|
|
|
You can't unless you write your own code to custom draw the cells. There is no built-in support for what you want to do. The cells in the DGV work nothing like a RichTextBox.
|
|
|
|