|
The Article by Softomatix in CP.
Hope this article will help you.
Regards,
Satips.
|
|
|
|
|
Can I do the coding for chechking the permission in my application.
Rather than using external components ?
Thanks in Advance
|
|
|
|
|
I have not yet coded for checking the permission in my application. But in Dot net
The .NET security system is a marvelously intricate invention. You can customize the permissions available to an individual assembly or a group of assemblies (such as all code from a particular publisher) on an amazingly granular level. But many developers are a bit hazy on how all of the pieces fit together to generate these permissions.
The Basic Concepts,To get started in .NET security, you need to understand three basic concepts:
(1) Permissions
(2) Permission Sets
(3) Code Groups
Regards,
Satips.
|
|
|
|
|
Hey guys, I need a little help and i am hoping you guys can do the trick. What i need to do is this. I need to create a delployment project that installs a service which I can do, but during the install of the service I need the user to be prompted to enter a server ID and then have that get changed in my source code, so the service knows which server to talk to after it is installed.
I am thinking it is pretty easy to do, but I am uncertain how to do it.
Please help!!
Thanks, Travis
|
|
|
|
|
You don't change the source code. Your service should be written to pick up it's configuration from a known place, like a config file or from some place in the registry. The "custom action" (Google this!) in your setup should write that server name to the place where your service expects it.
|
|
|
|
|
Hi again!
I've hit a snag developing my Speech Notepad program. I'm trying to get the Microsoft SDK 5.1 to read out the text that is on the line where the cursor is located on. Is there a way of getting and speaking the lines contents without selecting it?
Thanks!
josh0476
|
|
|
|
|
Your code has to supply the string to the SDK. You can figure this out by looking at the SelectionStart property. It will always be the position of the blinking insertion point.
|
|
|
|
|
Hi,
I have a 2 column array that is 32 by 2. Dim table(32,2) as sting
There is Load button to pull the data to the datagrid / datagridview
The data will be edited in the datagrid / datagridview
Then a save button to save the data back to the array.
Can anyone help?
|
|
|
|
|
Well, you can't bind a DataGridView to a multidimensional array, only a single.
A better solution would be to create a class that holds the information you need in member variables exposed by properties, then create an ArrayList, or some other IList or ICollection collection, to hold all of your objects. You can then bind the datagrid to that collection and edit the collection directly.
|
|
|
|
|
Thanks I will look at that.
|
|
|
|
|
Hey guys the problem that I am is this. I am writting a service that every five minutes goes out and requests a web page. And the problem that I am having is whenever I disconnect my computer for the internet, the service throws an error. I have tried implementing some error handling but I can't seem to figure it out. I would like to code somethingso that if in 30 seconds a response is not gathered then to abort the request and try again in five minutes. Here is the code that i currently have:
Imports System
Imports System.IO
Imports System.Net
Imports System.Threading
Public Class VirasecHB
'Declare the Thread
Private VirasecHB_Thread As New Thread( _
New System.Threading.ThreadStart(AddressOf waitProcedure))
'Declare Variables
Dim serverID As String = "1336"
Dim webURL As String = "http://www.virasec.com/intranet/tech/heart/heartdb.asp?hdur=300&hsid=" & serverID
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
WebRequestProcedure()
VirasecHB_Thread.Start()
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
VirasecHB_Thread.Abort()
End Sub
Private Sub WebRequestProcedure()
' Create a request for the URL.
Dim request As WebRequest = WebRequest.Create(webURL)
' If required by the server, set the credentials.
request.Credentials = CredentialCache.DefaultCredentials
'Sets web request timeout time
request.Timeout = 30000 ' 30000 = 30 Seconds
' Get the response.
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
'Close the response request
response.Close()
End Sub
Private Sub waitProcedure()
Do
'Wait Five Mintues
System.Threading.Thread.Sleep(300000) '300000 = 5 Minutes
Try
WebRequestProcedure()
Catch ex As Exception
Dim errorLog As New EventLog
errorLog.WriteEntry("Virasec Heartbeat Service " & _
"has encountered an error while trying to " & _
"connect to the Virasec web server. " & _
"The service will attempt to " & _
"connect again in five minutes.", EventLogEntryType.Error)
End Try
Loop
End Sub
End Class
If there is anything you guys can do to help please let me know.
Thanks again,
Travis
|
|
|
|
|
tcombs07 wrote: the problem that I am having is whenever I disconnect my computer for the internet, the service throws an error.
This line might be the problem...No internet connection, no getting to www.virasec.com.......
tcombs07 wrote: Dim webURL As String = "http://www.virasec.com/intranet/tech/heart/heartdb.asp?hdur=300&hsid=" & serverID
|
|
|
|
|
You have to mention the Error you're getting to get more precise answers.
I can only make a wild guess with the information you've provided.
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
In most probability, the CType you're doing is throwing an error as the Reponse object returned by the GetResponse() method will be null if it can't reach the Http server.
Enclose the above line in a Try..Catch block.
AND, next time, post the error message or what it says, as well.
SG
|
|
|
|
|
You'd have to completely redesign this. All of your code was written on the assuption that the request would work and only the occasional error would happen.
Turn it around and design the service so that it assumes that every request to the site will FAIL. For instance, this:
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
'Close the response request
response.Close()
always assumes that the response returns an object that you can close. Don't call close on an object that you don't know exists. Test for an object first, THEN call close on it if it's legitimate:
Dim response As ...
If response Is Nothing Then
' The request obviously failed...
Else
response.Close()
End If
|
|
|
|
|
Hello all,
Here's my situation:
I have a form with a listbox and a textbox, both with the same collumn of a databasetable.
When i click an item in the listbox i want the textbox to show the item as well.
I tried the following code:
Me.BindingContext(dsGroepAgent, "groep").Position = lstgroepen.SelectedIndex
When i click an item in the listbox the following error occured:
An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll
Any idea
|
|
|
|
|
You better don your asbestos suit for posting this in the programming forums, where, if you bothered to read the Posting Guidlines, posts like this are expressly forbidden.
|
|
|
|
|
Dave Kreskowiak wrote: You better don your asbestos suit for posting this in the programming forums, where, if you bothered to read the Posting Guidlines, posts like this are expressly forbidden.
Where did the original post go? I wanted to flame it
|
|
|
|
|
It was a recruiter from TEKsystems, posting a job opening in Illinois. You know, the exact same email he blindly sends to hundreds of people, praising their resume, without having even seen it!
|
|
|
|
|
Dave Kreskowiak wrote: It was a recruiter from TEKsystems, posting a job opening in Illinois.
Oh, that guy. I just barked at him for cross-posting and actually did a friendly suggestion of the CP job board :->
|
|
|
|
|
Hi,
I am new in programming, I involved in development new project related to point of sales using Visual Basic.Net , i need some tips about how to make bar code reader (or Manually) can read the code on the items, and put it in datagrid of the project.
.... Please some help
thanks
new member
|
|
|
|
|
Mr. Wonderful wrote: I am new in programming
You're in WAY over your head already. This is a very complicated project for someone who has little experience in programming, let alone using specialized hardware like this.
The barcode reader simply reads the code from the item and sends that number t your code. How you get it depends entirely on the barcode reader you're using. Some send the data over a serial port, others over TCP/IP, and still others through the keyboard, just like the user typed the code.
You put the data into a database, not a DataGrid. There's tons of examples all over the web, you simply have to Google for something like "insert data into Access database VB.NET", or whatever database engine you're using.
|
|
|
|
|
Mr Dave,
Although I expect your replying, I didn't mean explain all about how to filter data into datagrid, but I mean to how to begin. I know I'm not a professoinal developer to develop like this project, but just all I want is guid me how to begin, and you did it, thanks again.
regards
|
|
|
|
|
hello,
how can i see for how much % the processor (CPU) is being used? (just like in the task manager) Thanks in advance,
--Zaega--
|
|
|
|
|
I found this example awhile ago, and it's still the only way that I've found to read CPU usage that actually works.
Dim eIdle As Int64
Dim eKernel As Int64
Dim eUser As Int64
Dim sIdle As Int64
Dim sKernel As Int64
Dim sUser As Int64
Dim cIdle As Int64
Dim cKernel As Int64
Dim cUser As Int64
Dim systemTime As Int32
Dim totalCpuUsage As Single 'Long 'Int64
Public Declare Auto Function GetSystemTimes Lib "kernel32.dll" (ByRef idleTime As Int64, ByRef kernelTime As Int64, ByRef userTime As Int64) As Boolean
Dim updateSpeed As Integer = 500
Public Sub GetCPUUsage()
'Retrieve the Times values before starting the delay.
GetSystemTimes(sIdle, sKernel, sUser)
'The delay for how often to check and update the cpu usage values.
Threading.Thread.Sleep(updateSpeed)
'Retrieve the Times values after the Delay.
GetSystemTimes(eIdle, eKernel, eUser)
'Get the values calculated between the starting and ending Times values.
cIdle = (eIdle - sIdle)
cKernel = (eKernel - sKernel)
cUser = (eUser - sUser)
'Calculate the total system time. Which is Kernel and User time together.
systemTime = (cKernel + cUser)
'Simply check if the rounded option is true or not and display the usage value.
totalCpuUsage = (systemTime - cIdle) * (100) \ (systemTime)
'System.Windows.Forms.Application.DoEvents()
CPUUseLbl.Text = "CPU Usage: " & totalCpuUsage.ToString & "%"
Dim Ok As Integer = 0
End Sub
Hope this helps.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
That's a ton of work for something that's supplied by the PerformanceCounter class already...
[EDIT] Helps if I put the correct class name in...
-- modified at 14:45 Monday 14th May, 2007
|
|
|
|