|
Dave Kreskowiak wrote: The operating system just looks at the file extention to pick the icon that it's going to show for that file. If .ZIP is the REAL extension of the file (did you turn on Show File Extensions in Explorer??), AND there is a registered application that handles .ZIP files, the file you write will be shown with whatever icon the application registered with Explorer.
There is NO code you can write the will change this!
My mistake, I thought he meant his app would show the contents of a directory and he wanted his own icons...
quite frankly I'm not sure I even understood what I just said.
Apologies.
Elie Aintabi
|
|
|
|
|
I have got a question about DirectSound that I hope someone can help me with. I have made a test application with three buttons and one label.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim _dev As Device = New Device
_dev.SetCooperativeLevel(Me.Handle, CooperativeLevel.Priority)
Dim BufferDesc As BufferDescription = New BufferDescription()
BufferDesc.ControlVolume = True
BufferDesc.GlobalFocus = True
Dim TheSound As SecondaryBuffer = New SecondaryBuffer("C:\Test.wav", BufferDesc, _dev)
TheSound.Volume = -500
TheSound.Play(0, BufferPlayFlags.Looping)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
My.Computer.Audio.Play("C:\Test.wav", AudioPlayMode.Background)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
For I = 1 To 100000
Label1.Text = I.ToString
Application.DoEvents()
Next
End Sub
Now if I run the application and I press Button1 and then I press Button3 right after the sound stops. If I instead press Button2 and then Button3 the sound continues.
So my question is how can I make the DirectSound continue playing a sound without getting interupted when other code is executed?
Thanks in advance!
|
|
|
|
|
I don't know how, but I know that directsound lets you play multiple sounds at once, that's half the reason to use it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Well obviously that reason, together with being able to adjust the sound are the reasons to why I want to use DirectSound in the first place, else I would just have sticked with "My.Computer.Audio.Play". And both those things works perfectly, both to adjust the sound and play several sounds simultaneously. What I haven't been able to solve is to make the sounds continue playing when certain other types of code is being executed. (Like in the above example).
|
|
|
|
|
Put the code from button3 in a seperate thread.
Don't know if it will work but that would be my first try
|
|
|
|
|
Thanks for the tip. However I have already tried that and unfortunately that did not solve anything. I have also tried to put the code in Button1 in a separate thread. And just to make it even more clear if I would add a menu, just clicking on the menu (with no code attached to it) could make the sound stop. (Sometimes it does, sometimes not, keep clicking the menu and it will stop for sure.)
|
|
|
|
|
I would appreciate if someone could help me.
|
|
|
|
|
Uhhh...what? This isn't even your thread, so noone is going to have a clue what you're talking about.
|
|
|
|
|
Hi Guys,
I have written an application using vs2005 that connects to sql2005.
i have installed it on several user computers.
how can i prevent a user from copying the exe/program from their pc and using it on another site/company.
i have thought about hardcoding the m/board serial number into the app(but this is not a good option)
i also thought about creating a license file but not sure on how to cos the user can copy the exe and lic file as well.
any ideas?
thanks in advance...
Anoop
|
|
|
|
|
preventing a copy isn't possible (for as far I know)
What you could do is generate a code (using the pc name or something else unique for that pc) wich the user then has to send to you and you create a key from that (and send it back to the user).
That way the key is specific for the pc and even if the user copy's the file (and try's to use the same key) the program is not going to work (will ask for a new key)
You can store the key anyway you like since it is pc specific.
|
|
|
|
|
Hi Thanks for your response ,
do you perhaps have a sample project or maybe a site i can visit for ideas?
Thanks Again
Anoop
|
|
|
|
|
Anoop Brijmohun wrote: that connects to sql2005
If the app relies on data from sql server why not restrict access to known users? That way the user can copy the application to another computer, but only 'registered' users can actually do anything.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I would have thought a login / password system was already implemented, but if he did things the way I used to do them when I was starting out (before I discovered web services) I used to hardcore a login and password and then would query a table based off their login / password entry.
If you're going to do it that way, make sure the user you create to check that table has only access to read that tble and only that table, and use encryption in case they try to read your entire table.
|
|
|
|
|
I was meaning at a server level - using either windows authentication or create a user and generate a password. Either way, no access to the sql server means no reading the tables.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
As I mentioned to the OP, could always store the machine's serial number info in the database and have the app check against known values at runtime. If it doesn't find the machine's serial number in the database, just have the crap out without any warning [evil grin]...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Yep, that would work, although I prefer to prevent any access to the database... and then crap out
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Ashfield wrote: prefer to prevent any access to the database...
Perhaps just have a separate database for licensing purposes.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Could do. There are loads of options really.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi Thanks for your response and the ideas,
however,
lets also suppose the app is installed at a particular company, there is an administrator who has authority to access all sql dbs,
lets also suppose that the sister company can at any stage walk in, have a look at the software and then make copy of the software and sql db and take it with them...
how do i prevent this from happening...
i would think i need some sort of lic key generated that includes the licensed company...
any ideas>??????
thanks again
Anoop
|
|
|
|
|
Anoop Brijmohun wrote: thought about hardcoding the m/board serial number into the app(but this is not a good option)
You could have a separate table in your sql2005 database that stores the motherboard serial numbers of the machines that are allowed to run the app. Have the app check against known serial numbers in the database before running.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
for off-line copy protection the only solution AFAIK relies on some hardware characteristics. You must either choose built-in hardware or a separate protection device such as a dongle.
Choosing things the user can change (such as computer name) does not make sense to me.
Choosing things the user might want to change (CPU type, amount of RAM, disk serial number, etc) would be annoying: changing them for a good reason might break the software.
Baseboard numbers look great, except I was told they get stored in the BIOS and get lost when you upgrade your BIOS, resulting in all dependent software becoming useless.
So I would opt for an external piece of hardware. Dongles, costing a few tens of dollars/euros, are fine for expensive software. For cheaper software my first choice would be USB sticks, they all seem to have a unique serial number which you can retrieve through WMI (also as a regular user on Vista), and most users already have one or more USB sticks for other purposes anyhow. So have them provide their serial number, encode it in a license file, and have the app check the USB stick against the license file.
|
|
|
|
|
USB - now I didn't know that. You could actually get the user to register a USB and periodically (every couple of months) ask for a validation. If it fails they need to get in touch to register another USB and you can deal with that.
And then you have my position where corporate have disavled the USB slots on all machines
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
There are systems out there that use a USB stick to validate a program.
If the stick isn't present the program isn't going to start.
It has several advantages
- Program is licensed (biggest one for the programmer)
- The user can secure its usage (if he takes the stick out nobody else will be able to use it)
- It's not specific to a pc but per user so the user can install it on a differant pc and use the same stick (not at the same time)
- It's not that difficult (at least from what I hear (not my department))
- It's not expensive (just look at the price of usb sticks these days)
(Don't know why I didn't think of this when I posted my answer, we use it, must be the lack off sleep latly )
|
|
|
|
|
Only trouble with using usb sticks, more and more corporates are disabling the ports to prevent unauthorised copying - particularly in the UK where there have been some high profuile data losses due to usb sticks. In my current client company any device plugged into a usb port gets automatically encrypted - not good for your ipod!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Yeah but these sticks don't actualy hold data (from the company) they just hold a key and the program checks if the stick (so the key) is present.
The sticks themself can't be accesed so no data can be placed on them.
And I just found out that it's possible to have only 1 stick for an entire network so the stick could be plugged into a server in the server room that normally should be secure
Ashfield wrote: In my current client company any device plugged into a usb port gets automatically encrypted - not good for your ipod!
But but what will you listen to then
|
|
|
|