|
I want to Restrict Websites on IE through a LOG file eg XML all the restricted websites will be given in that XML file and whenever a user open on my pc the site my program will check that whether it is restricted site through checking XML file
Please help me out ..
Thanx in Advance
R A M RIz
|
|
|
|
|
I know and understand math operators in vb.net. I am only using vb.net. I create a math windows application but cannot get the gist of using fractions. In the like using a fraction to retrieve a result in fraction.
(e.g. 1/4 + 1/8 = 1/2). Can anyone help in this instance of programming with fractions in Visual Basic.Net. The language is not written in C# or vb6, but in visual basic.net.
bravo659
|
|
|
|
|
Dessi Bravo wrote:
1/4 + 1/8 = 1/2
You mean 3/8
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Yeah I meant 3/8. Would anyone know how to convert this from a decimal to a fraction, or fractions only?
bravo659
|
|
|
|
|
Hi please help with code to use a picturebox control or image control to display a photo from an access db the field name is photo and the datatype is memo. How can it contain the string character? When i try this code picturebox1.picture = stu("photo") i receive a datatype error.
thanks
|
|
|
|
|
This shouldn't be a memo field, but an OLE Object field.
I am assuming that you want to display a photo IN an Access form or Report, not FROM an Access database.
In any event, Access won't take the image into the database unless the field type is OLE Object. Once you use this object, you will get additional controls to import images into the record.
You won't need to code this either.
mmcdonald
|
|
|
|
|
i want to open cash drower when i print a report how should i do this using
Com port or LPT port.
can any one help me out there.
thanks.
|
|
|
|
|
Just a quick guess, but have you tried just printing a ^G (Control-G) to the printer port the drawer is connected to?
The last set of cash drawers I worked with were triggered by a simple bell character (Control-G) being sent to the LP port.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
I have an assignment at school and I need to take a comboBox and make the contents of it into an array(regular,Premium, Super)and a numericupdown box that goes from 0 to 100 and 2 textBoxes and do the following.
when the the numericupdown box's value is changed it will put that value into a txtBox (like a gas pump) and then in the other txtBox it will take that value from the first txtBox (that is connected to the numericupdown) and muliply it by the value of regular(which is .90)and so forth and so on with the Premium(1.00) and the Super(1.10). I don't know how to do it. I have gotten the value of the numericupdown to show in the first txtBox but I don't know how to get them to multiply. I keep getting and error of cannot convert a String to a double and I don't know how to correct it.
this is what I have:
Dim Gas(3) As Double
Private Sub nudValue_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudValue.ValueChanged
txtValue.Text = CStr(nudValue.Value)
Gas(0) = 0.9D
Gas(1) = 1D
Gas(2) = 1.1D
txtGasTotal.Text = txtGasTotal.Text * txtValue.Text
End Sub
Am I on the right track or completely of course.Please help.
|
|
|
|
|
Try this:
txtGasTotal.Text = (CDbl(txtGasTotal.Text) * CDbl(txtValue.Text)).ToString
I bet you have Option Strict enabled and that does not allow implied type conversion like VB6 used to. You have to explicitly convert before doing the math.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Yes I do have Option Strict On. I tried the code that you suggested and it didn't work. I keep getting an error that says "disallows implicit conversion from double to String." If there is any other help that you could give me I would greatly appreciate it.
|
|
|
|
|
Ok, not qwuite sure what you are traying to do here but I just typed in this code and it worked fine (no conversion errors).
Private Sub nudValue_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nudValue.ValueChanged
txtValue.Text = CStr(nudValue.Value)
Gas(0) = 0.9D
Gas(1) = 1D
Gas(2) = 1.1D
txtGasTotal.Text = CStr(CDbl(txtGasTotal.Text) * CDbl(txtValue.Text))
End Sub
This will also work:
txtGasTotal.Text = (CDbl(txtGasTotal.Text) * CDbl(txtValue.Text)).ToString
In the second sample play close attention to where the parens are. It makes a difference.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Is there a way to get the source code from axWebbrowser.
I have a web site that get a cookie for me where i go to it. I want to be able to get the source code.
I'm have tried WebRequest but this doesn't send the cookie it need to log on the their web site.
The source code i get from the WebRequest is to log on to the web site.
I want the source code of a page that i have to send a cookie to log on to see the right source code.
Can any one Help
Tdaigs
|
|
|
|
|
I need help here. Usually in the old VB6 world, I used the standard ado connectivity to connect to to my Oracle Databases, with Oracle Client installed on my box, system DSN entries and a TNS Names File.
I am now attempting to connect to my Oracle DB through VB.Net and the System.Data.OracleClient because I need to take advantage of a stored proc that returns a cursor. All examples of connection strings for the OracleCleint.Connection are akin to "Data Source=Oracle8i;Integrated Security=yes" or "Data Source=Oracle8i;User Id=userid;Password=pwd". This is not helping me at all. On the server I need to connect to there are 3 Oracle 9i servers running. Each with its own sid. I have tried things like "Data Source=sidname;User id=userid;Password=pwd" and get TNS Listener errors.
Should I be using something more like "Data Source=serverip,sidname;User id=userid;Password=pwd"? Any help would be appreciated.
Steve
|
|
|
|
|
Hello yall!!
Can anyone tell me why this API call works in vb 6.0 but not in vb .net
this is the functions:
Private Declare Function GetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Integer) As Boolean
Private Declare Function SetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Integer) As Boolean
this functions returns true if scucessful and false if not
in vb 6.0 it returns true but in vb .net it returns false
by the way the functions is used to set and get the screen gamma/brightness
SuperDude84
|
|
|
|
|
You might want to post the code your used in VB.NET, so we can see what your doing...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i give you the code:
Private Declare Function GetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Integer) As Boolean
Private Declare Function SetDeviceGammaRamp Lib "gdi32" (ByVal hdc As Long, lpv As Integer) As Boolean
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Integer, Source As Long, ByVal Length As Long)
Dim SavedRamp(255, 2) As Integer
public REG_KEY as string = ""
Private Function CheckReg() As Boolean
If REG_KEY = "password" Then
CheckReg = True
Else
CheckReg = False
End If
End Function
Private Function Lng2Int(Value As Long) As Integer
CopyMemory Lng2Int, Value, 2
End Function
Public Function GetGamma() As Double
If CheckReg = False Then Exit Function
If GetDeviceGammaRamp(GetDC(0), SavedRamp(0, 0)) = False Then Exit Function
Dim rgb(2) As Double
Dim I As Integer
Dim J As Integer
On Error Resume Next
rgb(0) = 1.01
rgb(1) = 1.01
rgb(2) = 1.01
For I = 0 To 2
Dim Csum As Double
Dim Ccount As Integer
Csum = 0
Ccount = 0
For J = 0 To 255
If J <> 0 And SavedRamp(J, I) <> 0 And SavedRamp(J, I) <> 65536 Then
Dim A As Double
Dim B As Double
Dim C As Double
B = (J Mod 256) / 256.01
A = SavedRamp(J, I) / 65536.01
C = Log(A) / Log(B)
Csum = Csum + C
Ccount = Ccount + 1
End If
Next J
rgb(I) = Csum / Ccount
Next I
GetGamma = rgb(0)
End Function
'Gamma is between 0 and 2
Public Function SetGamma(Gamma As Double) As Boolean
If CheckReg = False Then Exit Function
Dim Ramp(255, 2) As Integer
Dim nVal As Integer
Dim I As Integer
For I = 0 To 255
nVal = Lng2Int((((I + 1) / 256.01) ^ Gamma) * 65535 + 0.5)
Ramp(I, 0) = nVal
Ramp(I, 1) = nVal
Ramp(I, 2) = nVal
Next I
SetGamma = SetDeviceGammaRamp(GetDC(0), Ramp(0, 0))
End Function
Try this out in vb 6.0 and vb.net
|
|
|
|
|
An integer in .NET is 32 bits
If you want to get a 16 bit number use Int16...
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I have tryed to change all of the integers to int16 but it didn't help!
i have one solution that i have been using and that is to create a dll using vb 6.0 and referance it in vb.net
that solution works great but only om my computer. on other computers i get a error, something about dll is now registered
i have tried using "c:\WINDOWS\system32\regsvr32.exe" but that dosen't work either??
help please?
|
|
|
|
|
Hi, I have som dynamic data that I want to send via Email with CDO.Message but I dont know
how I get the Loop inside the msg.HTMLBody.
This is the code I need to run to create the dynamic part, how to I get it inside the msg,HTMLBody?
sTotal = 0
For Each Key in dictCart
aParameters = GetItemParameters(Key)
%>
<%= aParameters(1) %><%= dictCart(Key) %><%= strCurrency%> <%= aParameters(2) %><%= strCurrency%> <%= FormatNumber(dictCart(Key) * CSng(aParameters(2)),2) %>
<%
sTotal = sTotal + (dictCart(Key) * CSng(aParameters(2)))
Next
'Calculate shipping - you might want to pull this out into a function if your shipping
' calculations are more complicated then ours.
If sTotal <> 0 Then
If strCurrency = "SEK" Then
sShipping = (rsShipping.Fields.Item("FieldShippingSEK").Value)
Else IF strCurrency = "USD" Then
sShipping = (rsShipping.Fields.Item("FieldShippingUSD").Value)
Else
sShipping = (rsShipping.Fields.Item("FieldShippingEUR").Value)
End IF
End IF
Else
sShipping = 0
End If
sTotal = sTotal + sShipping
%>
Shipping (<%=strCountry%>):<%= strCurrency%> <%= FormatNumber(sShipping,2) %>TOTAL:<%= strCurrency%> <%= FormatNumber(sTotal,2) %>
Best Regards
Martin
|
|
|
|
|
Hello All
how can i connect to remote sql server FROM VB6
This is my sample connections strings
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim str As String
On Error GoTo HAND
cn.ConnectionTimeout = 30
Dim ConnString As String
Method 1
--------
cn.Open "Trusted_Connection=yes;driver=SQL Server;server=20.19.69.13;database=XXXX;User Id=YYYYY;Password=ZZZZ"
str = "Provider=SQLOLEDB.1;Server=23.19.69.13;Database=xxxx;Uid=yyyy;Pwd=zzzz"
cn.Open str
Method 2
--------
cn.Open "Provider=MS Remote;Data Source=XXXX;Remote Server=http://www.mysite.com;USER ID=XXX;PASSWORD=YYYY"
|
|
|
|
|
Try to check the connection from here[^] and let me know whether it is working not.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I have recently written a program in Visual Basic 6.0 that use ADO to talk to both a SQL Server database and also an MS Access 2000 database. They both use the same code to talk to the database.
When run on the development machine (XP Pro) the program can talk to the SQL Server database and MS Access database with ease.
When run on a virginal XP Pro machine the program can talk to the SQL Server database - SELECT, UPDATE, INSERT and DELETE all work fine. However, when trying to do the same on the MS Access database only SELECT and DELETE works? INSERT and UPDATE cause the program to freeze. No errors are thrown up, the program just locks up!
I have checked the folder / file permissions of the MS Access database to ensure I have the correct priviledges (I do) but cannot resolve the problem?!
I am a bit desperate here as the program needs to be delivered in the next week and this was the final stage of packaging!
Many thanks in advance!
- Pete -
|
|
|
|
|
Pete Belcher wrote:
Visual Basic 6.0 that use ADO to talk to both a SQL Server database and also an MS Access 2000 database
Please post the connection string between VB -> SQL and VB -> Ms access.
Pete Belcher wrote:
when trying to do the same on the MS Access database only SELECT and DELETE works? INSERT and UPDATE cause the program to freeze. No errors are thrown up, the program just locks up
Please post the code that have a problem in your application. One morething, do you use VB6 or VB.Net?
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Found out it was the actual PC that was failing!!
Install MS Access to see if a driver etc was missing but MS Access was unable to open any tables within ANY database. You could open an Access database and see the tables but whenever you tried to open the table an error box appeared with just "Unknown" written in it!!
Guessing whatever it was that caused Access to fail also caused my application to fail!! Tried to reinstall Windows but the Keyboard no longer works etc... Something very odd is happening!!
Setting up another new machine from scratch to see if it will work!
Thanks for your suggestions though!
- Pete -
|
|
|
|