|
Dear friends
hi!.i m new to vb. can u tell me is there any way to set access permission to the file using vb code so that file can not be shared.
actually i have a set up file.after installation i don't want computers to access exe file in a network except one where set up is installed.so can anybody tell me how can i do that.is there any way to code my program so that i can acheive this goal.or any third pary tool is available for that.Please help me. any help will be appriciateable.
be the best...be helpful for others
|
|
|
|
|
Disable File Sharing for your App folder and it can only be xecuted
from the local computer. However, if the user has sufficient permissions they can share it anyway and still launch your App from the network.
I can't check the below code right now, no network. So forgive me if it doesn't work.
- Create a new project
- Add two labels next to each other on form one.
<br />
Private Sub Form_Load()<br />
<br />
Label1.Caption = "Path:"<br />
<br />
'If you only want one instance of your app<br />
<br />
If App.PrevInstance Then<br />
MsgBox "You are not allowed to start more then one instance of My App.", vbExclamation + vbOKOnly, "My App"<br />
Unload Me<br />
End If<br />
<br />
Label2.Caption = App.Path 'Display path.<br />
<br />
' Check if excuted from network<br />
<br />
If InStrB(Label2.Caption, "\\") <> 0 Then ' Double slash is network path<br />
MsgBox "You are not allowed to start My App from a remote computer.", vbExclamation + vbOKOnly, "My App"<br />
Unload Me<br />
End If<br />
<br />
End Sub<br />
Compile the code and run the exe. Run it again while the other is still open and see what happens. Close the exe. Now start it from a different computer on your network and see if it starts or displays the message.
HTH
Jottum
-- modified at 8:45 Friday 11th November, 2005
|
|
|
|
|
There's nothing you can do in your code to prevent this. Even if your installation removes the share, there is nothing preventing the admin of the machine from just sharing the folder your app is stored in and nothing you can do to prevent it. You have absolutely no control over this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a set of ms-access queries in .txt file.
How can i execute those queries from a vb program?
-- modified at 4:11 Friday 11th November, 2005
I have got the code to execute the query from the text file but if a query
spreads across more than one line i am getting a problem because
i am using an array that stores each line in the database and executes it.
can u suggest how i can use a delimiter to indicate the end of a query or
an alternative.
Another problem is that i want to execute queries from many txt files.
Right now i have hard-coded the path of one of the text files.
I want to access each query sequentially( the user can't select) and i am working in vb 6 so kindly help
Please help.
Thanks in advance
-- modified at 6:09 Friday 11th November, 2005
|
|
|
|
|
VB6
Is this a list of queries to be accessed sequentially, or do you need to select?
Basically read the query from the file into a string, or string array depending on what you need to do, and then execute the appropriate string.
If you need more help I can assist if it is VB6
|
|
|
|
|
I want to know exact difference between Pag_Init() and Class constructor of page. What type of operations are possible in these. Thanks in advance.
|
|
|
|
|
I want to show images in dropdown. How it is possible. Can I put datagrid in dropdown. Thanks in advance.
|
|
|
|
|
I am currently working on a project that requires me to create a visual browser.... well, this is what i really want to do.. i have some pictures on my form, when the user place the mouse pointer over the picture, that picture would zoom up.. if the user moves the mouse pointer to the right or left. the picture would move in that direction.. something like the one they have in microsoft encarta.. can any one help me please!!!!
|
|
|
|
|
Basically, I don't know of any shortcuts, you need to code this behaviour yourself. Track the mouse, when it enters a picture, zoom it. If it's in a zoomed picture, move it as the mouse moves.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there a way to have the CommonDialog control return a path and not a filename?
Thanks,
Tim
|
|
|
|
|
|
The Folder Browser dialog is typically used if the user needs to select a folder only.
|
|
|
|
|
|
Commondialog1.initdir="C:\windows\system"
|
|
|
|
|
After a ComboBox_SelectedIndexChanged event, my application is taking over the CPU and using it to 100% and will not release it. I have step over every line of code and did not detect any infinite loops or what so ever.
Every line within the subs and functions that are used seem to be serving their purpose. The application continues running without any "trouble", I am able to go from one Dialog to the next one and back; execute every single piece of code within the project without errors, but the CPU will not stop running at 100%.
The controls involved are two Grids from C1.Componets, a standard ComboBox and the variables needed to keep track of the number of rows I am inserting given certain parameters each one declared within the subs or functions that use them.
Does this make sense to anybody? Any sugestoins on how to aproach the issue?
Thank you very much for your priceless help.
Alex (completely lost rookie)
|
|
|
|
|
alexvw wrote: After a ComboBox_SelectedIndexChanged event, my application is taking over the CPU and using it to 100% and will not release it
Almost certainly, the event handler is setting the selected index, which raises the event, which causes the index to be set, which.....
Either way, posting the code is the only way anyone can offer specific advice, as opposed to the guess I just offered you.
alexvw wrote: The application continues running without any "trouble", I am able to go from one Dialog to the next one and back; execute every single piece of code within the project without errors, but the CPU will not stop running at 100%.
That's odd then, I'd expect a non-responsive UI. Can you post the code ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot for your interest in my problem. I found out that my application behaves in such a way only when I am running it in Debug-Mode. I built the release version of it and it works without messing with the CPU at all.
Once again, thank you very much for your help.
Alex.
|
|
|
|
|
Alex, I'd be suspicious of the SelectedIndexChanged event handler code since the CPU seems to peg after that event is fired.
Are you sure that the event handler does not create an infinite loop or sets (or resets) some variable that may cause repeated executions of the event? How is the combobox being populated? Is it manually or via some data control? Without inspecting your code it can be hard to provide any clear cut answer.
Have a look at Task Manager to see whether or not it is VB or some other process that is consuming the CPU. That may give you some clues.
...Steve
|
|
|
|
|
Thanks a lot for your interest in my problem. I found out that my application behaves in such a way only when I am running it in Debug-Mode. I built the release version of it and it works without messing with the CPU at all.
Once again, thank you very much for your help.
Alex.
|
|
|
|
|
I am new to .NET please help me out to start it
|
|
|
|
|
I don't think you could have asked a more generic question. You're going to have to specify what you want help with. Start what? The IDE (development environment)? Creating a project or application? What type of application, Windows Forms, Windows Service, Web Service, Class Library, or Web App? Or starting out learning VB.NET perhaps?
The quality of any answer to your question lies in the details of the question itself...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
First, install the IDE. Then, read the MSDN that came with it. Then buy a book/download some of the samples and play with them. If at any point you get stuck, ask specific questions here.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
johnalwaysweb wrote: I am new to .NET please help me out to start it
public void Main()
{
delete Microsoft.VisualBasic;
return 0;
}
Pumk1nh3ad illustrates that Intelligent Design oft goes awry. - Ed Gadziemski
|
|
|
|
|
I am using Printer.Print method to print some strings. The printer does not start printing until Printer.EndDoc method is not called. Why?
Another problem, I want to stop paper after printing some line until I order to move forward.
When I call Printer.EndDoc , printer starts printing and then eject all the remaining paper.
I want to use printer for billing on 3 inch paper strip with unspecified length.
Pleae solve my problem.
Thanks for you inclination to my problem.
Shoaib Nawaz
|
|
|
|
|
hellow ..
i have an updatedatagrid function how can i use it in other forum that dose not have the datagrid it self ?
|
|
|
|