|
You can't. Resources local to the machine the browser is running on are off-limits if security is tightened up enough. Running an artibtrary executable on the client machine is a high security risk, so it's not recommended your website depend on it. JavaScript has the same limitations.
|
|
|
|
|
Thanks for ur reply....
But our requirement is like that ie..i have a link on my html and when i click on that it should run an msi using a command like
strPath="http:/"/(servername)/(virualdirectoryname)/test.msi"
strPa="ALLUSERS=1
WshShell.Run "msiexec /i "& strPath & strPa
So pls let me know how can i achieve this without WshShell or should i go for asp.net....
|
|
|
|
|
Implementing this behavior as described will get you marked as a "virus". Why are you trying to bypass the user, shouldn't he/she give permission first?
I are troll
|
|
|
|
|
Thanks for ur reply....and our requirement is like that i can"t change that and our
application will be running in intranet...
Please help me out....
|
|
|
|
|
pradeep455 wrote: our requirement is like that i can"t change that
You can't install something on a computer without the owners' permission. In your case perhaps not the end-user, but there's a network admin responsible for that intranet, somewhere. Find that network admin and ask him to distribute it over the domain
Anything done to a PC without the owners' consent could be considered a crime in some countries. I'd suggest you get the opinion of a lawyer before proceeding.
I are troll
|
|
|
|
|
may be im not clear.....
im using ...
i have a link on my html and when i click on that im trying to run an msi which is in webserver using a command like
ie onclick(link) im calling the below function
Function f1()
strPath="http:/"/(servername)/(virualdirectoryname)/test.msi"
strPa="ALLUSERS=1
WshShell.Run "msiexec /i "& strPath &strPa
end Function
and it works fine only when the option "Initialize and script ActiveX controls not marked as safe" under Tools\internet options/Security/Customlevel/ActiveX controls and plugIns is set to prompt.....and if we set to any other option ie(disable) it fails ie it shows error when i click on the link like .. ActiveX component cannot create object "Wscript.shell"...
but our requirement is user does"nt want to to make any changes in the internet options...
So pls let me know how can i achieve this without WshShell....
|
|
|
|
|
The answer is no, take a hint. God.
|
|
|
|
|
p_1960 wrote: So pls let me know how can i achieve this without WshShell....
I'm sorry, there are no possibilities that I am aware of
I are troll
|
|
|
|
|
MSIEXEC will not get a file from a web server over HTTP. That command line is not going to work at all.
The only reason is works when you click on the link for an .MSI in a web browser is because the browser first downloads the file to the local machine, then launches the .MSI from the temporary location.
|
|
|
|
|
Thanks for ur reply....
May i know that is it possible to cretae our own ActiveX control(signed) with certificate and use it....instead of using WShell..If yes pls let me know how to do the same.....
pls correct me if im wrong...
|
|
|
|
|
VB.NET and C# don't target building true ActiveX controls. They built .NET assemblies that can LOOK like ActiveX controls (Com-exposed), but they can't be signed in the same manner a normal ActiveX control would be, and therefore cannot be used as such.
|
|
|
|
|
Thanks for ur reply....
So pls suggest me any other alternative to achieve the same......
|
|
|
|
|
For the last time. You cannot do what you want without modifying relaxing the browsers security settings and practically turning off all security. And no, you cannot do that from code running inside the browser...
|
|
|
|
|
p_1960 wrote: let me know how can i achieve this without WshShell..
you were told by many it can not be done. Sorry no other way.
why don't you give them a link to the msi file, explorer will ask them and let them click "run". What is wrong with that?
p_1960 wrote: but our requirement is user does"nt want to to make any changes in the internet options...
If the requirement is "wrong", then it need to be changed.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I am passing USername and password with out Encryption.
I need to solve this issue ith encryption and decryption in the loging form.
How to solve this issue using vb.net?
Can any one else help me to solve this issue.?
|
|
|
|
|
edwcodeproject wrote: How to solve this issue using vb.net?
You can't with VB.NET. You solve it by putting an SSL certificate on your server and directing the user to the login form via an HTTPS connection.
|
|
|
|
|
Use MD5, encrypt it on your form and send it as plain-text, if you enforce strict password rules (length, punctuation minimum, letters & numbers etc) it will be pretty hard to crack, BUT this is extremely bad practice.
|
|
|
|
|
|
|
|
Fail, Because I'm funny.
Maybe it was the double quotation marks.
|
|
|
|
|
Hi, I m trying to develop a small application where I have to read the data from csv file, display it in DGV and update the database so that I can execute a query related to the database. My code is as follows:
Public Class Form1
Dim myDA As OleDbDataAdapter
Dim myDataSet As DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=|DataDirectory|\db1.mdb")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM Sheet1", con)
con.Open()
myDA = New OleDbDataAdapter(cmd)
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(myDA)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "MyTable")
DataGridView1.DataSource = myDataSet.Tables("MyTable").DefaultView
con.Close()
con = Nothing
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Validate()
Me.myDA.Update(Me.myDataSet.Tables("MyTable"))
Me.myDataSet.AcceptChanges()
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=|DataDirectory|\db1.mdb")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM Query3", con)
con.Open()
myDA = New OleDbDataAdapter(cmd)
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(myDA)
myDataSet = New DataSet()
myDA.Fill(myDataSet, "MyTable")
DataGridView1.DataSource = myDataSet.Tables("MyTable").DefaultView
con.Close()
con = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Dim fi As New FileInfo(OpenFileDialog1.FileName)
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName
Dim Con As New OleDbConnection(sConnectionString)
Dim myDataSet As DataSet = New DataSet()
Dim cmd As OleDbCommand = New OleDbCommand
Con.Open()
myDA = New OleDbDataAdapter(cmd)
Dim objCmdSelect As New OleDbCommand("SELECT * FROM " & fi.Name, Con)
Dim objAdapter1 As New OleDbDataAdapter
myDA.SelectCommand = objCmdSelect
myDA.Fill(myDataSet, "MyTable")
DataGridView1.DataSource = myDataSet.Tables("MyTable").DefaultView
Con.Close()
Con = Nothing
End If
End Sub
End Class
Now my problem is that when I import csv into DGV and click button1, its not updating the database i.e its not executing my query3. I don't know what's wrong.
In fact what i want to do is just to import a csv file into an existing database and execute a query. I am not sure about the way in which I am doing it. Please suggest me.
|
|
|
|
|
Other than to make you feel better, why are you using the DGV. It's nice to see the data but I would not include it in the process. I would do the following.
Load the data from the CSV into a datatable
Use Bulkcopy to push it into the database.
This article may help[^]
I would never use the jet oledb connection to read the data (just prejudiced I guess).
Ah my mistake, you are using Access so the jet DB is already required.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can i use sqlCommand for access database also? I tried but it didnt support.
|
|
|
|
|
No, you must use the OleDb classes, or for more generic support, the Odbc class (I don't recommend them) to get to Access database. The Sql classes only work with SQL Server.
|
|
|
|