|
Hi to everybody, The am Italian and The don'ts write very well in English. The have this problem that The don'ts succeed really to resolve: I owe to effect to login on to site and subsequently to donwload HTTP to two pages web that contains burdens information. The don'ts succeed in understanding whether to make the login and to preserve the "LOGON", that is in practice the login doesn't succeed me. The page of the site is : http://www.tre.it:80/selfcare/areaclienti133/4552_infoCosti_ITA_LOGGED.xsl. Thanks thousand and I pray you helped me
seven
|
|
|
|
|
i have appication in that
when i click on "photo" btn it will connect to web cam & after capturing photo by cam i again will go on application.
At that time captured photo will display in picture box
what i do for that
|
|
|
|
|
Google for "vb.net webcam wia"[^] and you'll find lots of resources on how to do this.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi, everyone,
I'm writing a program to discover wireless network
using Windows Native Wifi API & VB.net.
I have to declare the windows API in my VB.net program.
The original windows declaration is as below.
The problem is in "struct _WLAN_AVAILABLE_NETWORK_LIST",
it declared "WLAN_AVAILABLE_NETWORK Network[1];".
I think which means a Network[] array of struct WLAN_AVAILABLE_NETWORK.
But how about the size of the Network[] array?
Is it "1" or more? what does "1" mean?
If I give it the size of 1, then I can get the first network back,
but if I give it more than 1, for example, 10,
then I got an error of "AccessViolationException".
The full message is "Service cannot be started. System.AccessViolationException:
Attempted to read or write protected memory.
This is often an indication that other memory is corrupt."
Actually, the size of the Network[] array is decided by
dwNumberOfItems at run time, which means the size of the
Network[] array is varied-length not fixed, and in most situations
, the size should be more than 1.
I've searched the solution on the internet, and found some similar situations.
They said we should use IntPtr to get the address of the structure array and
then use Marshal class(Marshal.copy(), Marshal.PtrToStructure()....) to get the array,
instead of declared it as a structure array, but they didn't post a sample Marshalling code.
I've tried to code, but still got "AccessViolationException" at Marshalling.
Anyone knows how to solve the problem?
Could you write a sample code for me in VB.net or C# without unsafe code?
Thanks so much. I appreciate your help.
Windows Native Wifi declarations:
'-----function-----
DWORD WINAPI WlanGetAvailableNetworkList(
HANDLE hClientHandle,
const GUID* pInterfaceGuid,
DWORD dwFlags,
PVOID pReserved,
PWLAN_AVAILABLE_NETWORK_LIST* ppAvailableNetworkList
);
'-----structure-----
typedef struct _WLAN_AVAILABLE_NETWORK_LIST {
DWORD dwNumberOfItems; '===>the actual size of array
DWORD dwIndex;
WLAN_AVAILABLE_NETWORK Network[1]; '===>how to declare the array? should I give it fixed size of 1 or change it to an IntPtr
} WLAN_AVAILABLE_NETWORK_LIST, *PWLAN_AVAILABLE_NETWORK_LIST;
typedef struct _WLAN_AVAILABLE_NETWORK {
WCHAR strProfileName[256];
DOT11_SSID dot11Ssid;
DOT11_BSS_TYPE dot11BssType;
ULONG uNumberOfBssids;
BOOL bNetworkConnectable;
WLAN_REASON_CODE wlanNotConnectableReason;
ULONG uNumberOfPhyTypes;
DOT11_PHY_TYPE dot11PhyTypes[8];
BOOL bMorePhyTypes;
WLAN_SIGNAL_QUALITY wlanSignalQuality;
BOOL bSecurityEnabled;
DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
DWORD dwFlags;
DWORD dwReserved;
} WLAN_AVAILABLE_NETWORK, *PWLAN_AVAILABLE_NETWORK;
typedef struct _DOT11_SSID {
ULONG uSSIDLength;
UCHAR ucSSID[32];
} DOT11_SSID, *PDOT11_SSID;
'-----Enumeration-----
typedef enum _DOT11_BSS_TYPE
{
dot11_BSS_type_infrastructure,
dot11_BSS_type_independent,
dot11_BSS_type_any
}DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;
typedef DWORD WLAN_REASON_CODE, *PWLAN_REASON_CODE;
typedef enum _DOT11_PHY_TYPE
{
dot11_phy_type_unknown,
dot11_phy_type_any,
dot11_phy_type_fhss,
dot11_phy_type_dsss,
dot11_phy_type_irbaseband,
dot11_phy_type_ofdm,
dot11_phy_type_hrdsss,
dot11_phy_type_erp,
dot11_phy_type_IHV_start,
dot11_phy_type_IHV_end
}DOT11_PHY_TYPE, *PDOT11_PHY_TYPE;
typedef enum _DOT11_AUTH_ALGORITHM
{
DOT11_AUTH_ALGO_80211_OPEN,
DOT11_AUTH_ALGO_80211_SHARED_KEY,
DOT11_AUTH_ALGO_WPA,
DOT11_AUTH_ALGO_WPA_PSK,
DOT11_AUTH_ALGO_WPA_NONE,
DOT11_AUTH_ALGO_RSNA,
DOT11_AUTH_ALGO_RSNA_PSK,
DOT11_AUTH_ALGO_IHV_START,
DOT11_AUTH_ALGO_IHV_END
}DOT11_AUTH_ALGORITHM, *PDOT11_AUTH_ALGORITHM;
typedef enum _DOT11_CIPHER_ALGORITHM
{
DOT11_CIPHER_ALGO_NONE,
DOT11_CIPHER_ALGO_WEP40,
DOT11_CIPHER_ALGO_TKIP,
DOT11_CIPHER_ALGO_CCMP,
DOT11_CIPHER_ALGO_WEP104,
DOT11_CIPHER_ALGO_WPA_USE_GROUP,
DOT11_CIPHER_ALGO_RSN_USE_GROUP,
DOT11_CIPHER_ALGO_WEP,
DOT11_CIPHER_ALGO_IHV_START,
DOT11_CIPHER_ALGO_IHV_END
}DOT11_CIPHER_ALGORITHM, *PDOT11_CIPHER_ALGORITHM;
|
|
|
|
|
Hi
I have question about using crystalreport in web browser. I use vb2005 to create crystalreport in default form and then use crystalreportviewver that can show the report in project but when I call from remote(intranet) it always ask " The report you requested requires further information."
and have textbox to fill Server name:,
Database name: ,
User name: ,
Password
[] Use Integrated Security
then have button Logon
but even I fill all data require it still can't open the report.
What I shall do next? thank you for your advice...
Kitty
|
|
|
|
|
try this code:
crpt = New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "xxxx"'databse password
myLogin.ConnectionInfo.UserID = "sa"'Database username
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt
Magi
|
|
|
|
|
Hello all i am having problem with the stream class, i am new to vb.net. Problem i have is as follows: cannot figure out for the life of me how to get this simple task going, writing using the stream to txt file is replacing the previouse entries instead of adding to the txt file. Next my cboBox is not updating with the info or populating the txt boxes with info from cboBox. I have a cboBox with 1-31 in it(days of month). For each day i need to store some numeric data tied to each day, well not working on mine, or better said dont know how to do it.. Help please..the code is as follows..
<code></code> Option Strict On
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
'Declare module-level variables
Private mblnIsDirty As Boolean
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboFecha.SelectedIndexChanged
'Dim test As Integer
'Dim datServicio As New StreamReader("Servicio.txt")
'For test = 1 To 31
' cboFecha.Items.Add(test)
'Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Load the items in teh cboFecha list
Dim dgrResponse As DialogResult
Try
'Open the file
Dim datServicio As New StreamReader("Servicio.txt")
'Read all elements into the list
Do Until datServicio.Peek = -1
cboFecha.Items.Add(datServicio.ReadLine())
txtLibros.Text = datServicio.ReadLine()
txtFolletos.Text = datServicio.ReadLine()
txtHorasH.Text = datServicio.ReadLine()
txtHorasM.Text = datServicio.ReadLine()
txtRev.Text = datServicio.ReadLine()
txtRvsitas.Text = datServicio.ReadLine()
Loop
'Close the file
datServicio.Close()
Catch 'File missing
dgrResponse = MessageBox.Show("Create a new file?", "File not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If dgrResponse = DialogResult.No Then
btnExit_Click(sender, e) 'Exit the program
End If
End Try
txtTotalLibros.Enabled = False
txtTotalFolletos.Enabled = False
txtTotalHorasH.Enabled = False
txtTotalHorasM.Enabled = False
txtTotalRev.Enabled = False
txtTotalRvsitas.Enabled = False
cboFecha.Focus()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'Save the list box contents in a file
Dim datServicio As New StreamWriter("Servicio.txt") 'Open the file
Dim intIndex As Integer
Dim IntMaximum As Integer
datServicio.WriteLine(cboFecha.SelectedIndex + 1)
'Next intIndex
With cboFecha
If .SelectedIndex <> -1 Then
datServicio.WriteLine(cboFecha.Text)
Else
MessageBox.Show("Select a Day", "No selection made", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End With
datServicio.WriteLine(txtLibros.Text)
datServicio.WriteLine(txtFolletos.Text)
datServicio.WriteLine(txtHorasH.Text)
datServicio.WriteLine(txtHorasM.Text)
datServicio.WriteLine(txtRev.Text)
datServicio.WriteLine(txtRvsitas.Text)
datServicio.Close() 'Close the file
mblnIsDirty = True
'Clears the cbo and txt boxes
cboFecha.Text = ""
txtLibros.Text = ""
txtFolletos.Text = ""
txtHorasH.Text = ""
txtHorasM.Text = ""
txtRev.Text = ""
txtRvsitas.Text = ""
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'Terminates the project
Me.Close()
End Sub
Private Sub btnNewMonth_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewMonth.Click
Dim datServicio As New StreamWriter("Servicio.txt")
'Closes the file
'datServicio.Close()
mblnIsDirty = False
'Opens the file
'Dim datServicio As New StreamWriter("Servicio.txt")
'Erases the Servicio.txt file
datServicio.Flush()
End Sub
End Class <code></code>
Thanks Francisco....
|
|
|
|
|
Hello all i am having problem with the stream class, i am new to vb.net. Problem i have is as follows: cannot figure out for the life of me how to get this simple task going, writing using the stream to txt file is replacing the previouse entries instead of adding to the txt file. Next my cboBox is not updating with the info or populating the txt boxes with info from cboBox. I have a cboBox with 1-31 in it(days of month). For each day i need to store some numeric data tied to each day, well not working on mine, or better said dont know how to do it.. Help please..the code is as follows..
Option Strict On
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
'Declare module-level variables
Private mblnIsDirty As Boolean
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboFecha.SelectedIndexChanged
'Dim test As Integer
'Dim datServicio As New StreamReader("Servicio.txt")
'For test = 1 To 31
' cboFecha.Items.Add(test)
'Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Load the items in teh cboFecha list
Dim dgrResponse As DialogResult
Try
'Open the file
Dim datServicio As New StreamReader("Servicio.txt")
'Read all elements into the list
Do Until datServicio.Peek = -1
cboFecha.Items.Add(datServicio.ReadLine())
txtLibros.Text = datServicio.ReadLine()
txtFolletos.Text = datServicio.ReadLine()
txtHorasH.Text = datServicio.ReadLine()
txtHorasM.Text = datServicio.ReadLine()
txtRev.Text = datServicio.ReadLine()
txtRvsitas.Text = datServicio.ReadLine()
Loop
'Close the file
datServicio.Close()
Catch 'File missing
dgrResponse = MessageBox.Show("Create a new file?", "File not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If dgrResponse = DialogResult.No Then
btnExit_Click(sender, e) 'Exit the program
End If
End Try
txtTotalLibros.Enabled = False
txtTotalFolletos.Enabled = False
txtTotalHorasH.Enabled = False
txtTotalHorasM.Enabled = False
txtTotalRev.Enabled = False
txtTotalRvsitas.Enabled = False
cboFecha.Focus()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
'Save the list box contents in a file
Dim datServicio As New StreamWriter("Servicio.txt") 'Open the file
Dim intIndex As Integer
Dim IntMaximum As Integer
datServicio.WriteLine(cboFecha.SelectedIndex + 1)
'Next intIndex
With cboFecha
If .SelectedIndex <> -1 Then
datServicio.WriteLine(cboFecha.Text)
Else
MessageBox.Show("Select a Day", "No selection made", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End With
datServicio.WriteLine(txtLibros.Text)
datServicio.WriteLine(txtFolletos.Text)
datServicio.WriteLine(txtHorasH.Text)
datServicio.WriteLine(txtHorasM.Text)
datServicio.WriteLine(txtRev.Text)
datServicio.WriteLine(txtRvsitas.Text)
datServicio.Close() 'Close the file
mblnIsDirty = True
'Clears the cbo and txt boxes
cboFecha.Text = ""
txtLibros.Text = ""
txtFolletos.Text = ""
txtHorasH.Text = ""
txtHorasM.Text = ""
txtRev.Text = ""
txtRvsitas.Text = ""
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'Terminates the project
Me.Close()
End Sub
Private Sub btnNewMonth_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewMonth.Click
Dim datServicio As New StreamWriter("Servicio.txt")
'Closes the file
'datServicio.Close()
mblnIsDirty = False
'Opens the file
'Dim datServicio As New StreamWriter("Servicio.txt")
'Erases the Servicio.txt file
datServicio.Flush()
End Sub
End Class
Thanks Francisco....
|
|
|
|
|
You didn't open the file for Append, you just opened it and started writing at the beginning of the file. Change your StreamWriter to this:
Dim datServicio As New StreamWriter("Servicio.txt", True) 'Open the file
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Finally it saves in the next lines, Thanks. Now the other problem. How do i get the cboBox going? Is the code in the form load ok, or should i just have code on the cboBox section on it? Or do i need both? CboBox not populating the rest of the txt boxes with correct info...
|
|
|
|
|
From what I've seen in this code, you seriously need to pick up a book on beginning VB.NET. Your logic (not code) skills need work.
The code in FormLoad opens a file and reads a line and populates a textbox with it, reads a line and populates a textbox with it, ..., until the end of the file. The end of file CAN be reached before you populate the last textbox. Also, every time you go though this loop, you replace the text in the textbox that was there on the previous pass!
On top of that, comboboxes don't populate anything. They just let the user pick an item. It's up to you to populate textboxes, which you don't provide the code for in your post. Come to think of it, the SelectItemChanged event for you combobox has all the code in it commented out, plus, it doesn't even describe populating textbox's.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I am new Dave, yes i have a VB.net I got from Junior College by Julia Case Bradley and Anita C. Milspaugh. I have gone through it and they just dont give too much specifics on this stuff, like the simple append Yes you told me, they never even implement it on the sample code they show... All examples they give were the way i had it before. I am trying but with one semester of vb.net, it's not enough to learn data section thats on the second semester, but due to classes being cancelled by them and schedule conflicts with the other ones i have not been able to take the second semester. All the code i have made here is little samples that are on the book and stuff i have found in the internet. As far as the section on the cbobox, i comented it out due to it not working, and besides wanted to get the writer to not overwrite my preveouse input. Yes the idea of this little program is to somehow tie 6 txt boxes i have to the day i select in the cbobox, to be able to select a day in cco and have the txt boxes show what was saved for that day entry... When i get home i will try to post a pic of how the program looks. Thanks for the patience and your helpful postings in this forum. By the way do you know the best vb.net book i can buy that shows exactly the way things are supposed to work not just part of it???
|
|
|
|
|
f_soto wrote: By the way do you know the best vb.net book i can buy
The best book is the one you can understand.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
The three left columns of my datagridview are frozen (pinned?) They don't move with the horizontal scrollbar the way the others do.
Can someone please tell me how they got that way and how to unfreeze them?
Thanks!
|
|
|
|
|
You might find some insight with this[^].
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Sorry, I don't understand that. It's not a control key issue. The first three columns are frozen no matter what.
|
|
|
|
|
Somehow, someway, you've set the Frozen property of the first three columns to True. You might want to search every file in your code and look for "Frozen" to see where this may have happened, and possibly remove those lines.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
yup... frozen property is what I was looking for. Thanks as always for your excellent help.
|
|
|
|
|
i want to expire the program after 30 day, and not affected with if the user set back the windows calender time
regards
k
|
|
|
|
|
You can't track the number of days if you use the system time, believe it or not. It's too easy to defeat. You can track the number of times the application is run though. Or, if your app requires Internet access, you can use one of the public time sources out on the net.
Tracking this will also require you to get very creative in storing the data in a manner that is not easiily detected and defeated, like encrypting and hiding the data in an inconspicuous file.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
thanks Dave too much,
i'll try to calculate total time the application run,
and i'll post you agian if you don't mind
regards
k
|
|
|
|
|
I have set up some of my programs with the following settings:
I have a file called Activation.dat that stores number of days left, trial start date, last recorded date, and trial type. If the file is missing the program will not execute. If the current date is less than the last recorded date the program will not execute. If the days left expires, the program will not execute. if the days between the trial start date and the last recorded date is greater than trial period, the program will not execute. When any condition voids the trial, the activation.dat file will only store the word expired which will prevent all further attempts. All of this is using high quality encryption and is checked for all versions of trials/shareware copies of the program.
You might even want to write a value to the registry which pretty much will be unedited by the average user that will prevent further installations of the program.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
thanks alot Thomas
i'll try this
and post here again
regards
k
|
|
|
|
|
Hi MrKode,
I have done something complete different. In the past I have programmed several ways for trial/demo/copy-protection.
The latest programm I have proteced with a tool from www.anubis.nl
This is the dutch distributor for this tool. The makers are lokates in the UK and the programm is called "CopyMinder".
Initial cost € 150. Just one and € 0,90 per activated programm.
Succes
Hans
|
|
|
|
|
I need to draw a metafile by using Memorystream.
But I don't know how to do this.
All sample I can find on the internet is C# or using Bitmap or using a real file. I hope I can draw it immediatelly on the form and don't have to use a file.
I have studied it several days but I still don't know how to do this.
Can any one give me a example? Just a simple one is ok. Like draw some words on the form, for example.
I would very appreciate it if some one can help me this.
|
|
|
|
|