|
So, you're generating the report file the CR is going to use "on-the-fly"?? I would suggest the CommonApplicationData[^] folder, but exactly which folder depends on your requirements.
You use that enum with Environment.GetFolderPath[^] and then you can use the Path class to build the complete filename.
|
|
|
|
|
|
Try this:
n = TextBox1.Text
If IsNumeric(n) then
Dim sTemp as string = n.Substring(0,1)
TextBox1.Text = n
End If
alex_nel
|
|
|
|
|
myventsi wrote: Why it' s not working?
Because your code is utterly wrong.
The last iteration of your while loop will result in n being zero, since that is what makes the while-test fail; now when n is such that n/10 is zero, then for sure n\10 is also zero.
What you need is a modulus operator, and fortunately your language has one.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Can anyone please give me a hint how to check whether a file i being accessed by another process or not, so that i can open it for manipulation.
Thanks in advance!
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Private Function isFileInUse(ByVal sFileName As String) As Boolean
Dim nFileNum As Integer
' If the file is already opened by another process and the specified type of access
' is not allowed the Open operation fails and an error occurs.
Try
nFileNum = FileSystem.FreeFile()
FileSystem.FileOpen(nFileNum, sFileName, OpenMode.Binary, OpenAccess.Read, OpenShare.LockReadWrite)
FileSystem.FileClose(nFileNum)
Catch
Return True
End Try
Return False
End Function
alex_nel
|
|
|
|
|
I'm trying to know whether the form is loaded into memory or not.
My form may be hidden.
|
|
|
|
|
|
Hi,
I am new to this vb.net, my problem is i have created the windows service in vb.net c#. I deployed it in my system when i am try to start that service it showing the error as
Error:1053 could not start the service on Local system
The service didnot respond to the start ro control request in a timely fashion
I have tried to resolve it, but i could not... Please help me to solve this problem.
Thanks in advance.
With Regards,
Samson
|
|
|
|
|
Does the deployment machine have the correct .NET Framework installed on it??
In the OnStart method of your service, did you create an instance of your worker class on a seperate thread?? You don't just put all of your code in OnStart and never let that method return. This is exactly the error you get when you do this.
Your worker code should be running under it's own thread, that you create in the OnStart event of your service.
|
|
|
|
|
Hi im new to this forum and programming in general!anyways iv wanted to write my own poker bot in visual basic for a while now because all the poker bots for sale online are controled by the casinos and you allways lose wot u win,if sum1 could help me with how i can:
1:get the bot to lock on to the table,i know that usually the bot injects into the dll files of the poker program but thats how the casinos detect the bot
2:get the bot to see my cards and the table cards.iv read about screen scraping but im not sure how this works.
3:i want to write the code for how the bot will decide weather to fold,call or raise based on how i play and the many books iv read on how to play but any tips are welcomed.
anyway any help would be great,
DySfUnKtIoNaL!!
|
|
|
|
|
Of the three things you've listed, only the third is really at your level.
Injecting DLLs into other processes is hacking and quite frankly I wouldn't know where to start - In fact, I'm not in the least bit interested in finding out because it isn't required for writing "normal" applications.
Screen scraping is basically taking a view of the screen and interpreting what is displayed there. If the "screen" is a text based console it is very easy (and that's what most screen scrapers are doing, converting the text on a console). If the "screen" is a web page it gets slightly trickier, but since it is essentially still all text then it is doable. It gets difficult when you have AJAX adding stuff into the page after it is loaded. Finally, there is the kind where the "screen" is a graphic. The graphic can be a snapshot of the screen at a particular moment, but it then has to apply some sort of OCR (optical character recognition) algorithm to the image to find out what it says. Unless you can supply hints to the OCR as to where the text is then it will be slow.
Finally, on to the algorithms for deciding when to hold, fold, raise, etc. That is fairly simple maths and there are books that tell you the odds so you can calculate it. As to how to program that... Well, it is a bit much for a forum response. I'd start by creating a list of all the rules and working out what I need to implement it.
|
|
|
|
|
dysfunktional wrote: 1:get the bot to lock on to the table,i know that usually the bot injects into the dll files of the poker program but thats how the casinos detect the bot
Yep. And you also cannot do DLL injection in C#, VB.NET, or any other purely managed language because they don't support the exports required to do DLL injection.
dysfunktional wrote: 2:get the bot to see my cards and the table cards.iv read about screen scraping but im not sure how this works.
You have to capture a screen image and, basically, do an OCR for the card values. The screen capture is the easy part. Reading the card faces is going to be VERY difficult, and frankly, WAY beyond your abilities.
dysfunktional wrote: 3:i want to write the code for how the bot will decide weather to fold,call or raise based on how i play and the many books iv read on how to play but any tips are welcomed.
This is not as easy as it sounds. There are sooo many card combinations and different ways to play them against a variety of players with varying skill, you'd have to write some kind of learning network that improved it's play as it went. If the bot played as you did all the time, you'd lose all your money in short order. Since you're not playing, you're not learning better skills, so your bot has to do the learning for you. I hope you're an expert in artificial intelligence and neural networks.
|
|
|
|
|
Hi 2 all,
we are developing a mini erp using vb.net.
It has couple of modules. According to the user requirement, custom modules should be installed. I was unable to write code for custom deployment.
My problems are :
1. It has to show the modules list while installing
2. according to the selected modules it has to deploy the application
Thanks in advance,
annoce
|
|
|
|
|
Why are you doing this in VB.NET? Why not a tool for creating installations? If you want something good that you don't have to pay for then WiX is very powerful.
|
|
|
|
|
I am currently creating a basic vb form program as part of my course work.
The form consists of 3 text boxes:
textbox1 is for the user to type a car's mileage when the petrol tank was filled
textbox2 is for the user to type the number of gallons of petrol just put in to refill the tank
textbox3 is for the user to type the new mileage after a journey
There is a button on the form which when clicked will calculate the miles per gallon.
Can anyone please help with the 'calculate' button code???
|
|
|
|
|
Sure. Lets see, what other application would use one or more buttons, and calculate something?
O wait, maybe a calculator does.
Now how do I find a calculator example with a full description and all of its source code?
Gee, if only there was a web site with programmer's stuff, some search engine increasing the probability I will actually find what I am looking for, and finally a chance to ask intelligent questions once I get stuck at a very specific detail after trying several things myself ...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
lexyvb.net wrote: textbox1
You should choose more descriptive names.
textbox1 could be called mileageAtRefuelingTextBox ; textbox2 could be called refuelAmountTextBox ; and, textbox3 could be mileageAtEndTextBox , for example.
lexyvb.net wrote: Can anyone please help with the 'calculate' button code???
Basically, distance in miles divided by fuel consumed in gallons equals miles per gallon.
You know your distance, mileage at end minus mileage at start.
Do you know the fuel consumed? Well, if you assume that you start with a full tank of petrol and you refuel at the end of the journey then the amount of fuel you fill up with is the fuel consumed.
That should be enough to get you going.
If you are still stuck, you'll need to show us your code, because we are not going to do your homework for you. Also, if you've not figured it out already, you'll have to have a very good understanding of algebra because the coding aspect of software development is largely algebra in whatever the syntax is of the language you are using.
|
|
|
|
|
Hi, I am working on some code which is designed to communicate with up to 16 embedded devices over a LAN with eventual real time data display and logging.
Using a series of UDP broadcasts, a rectangular array is populated with the ip addresses of the units.
This process is repeated at a regular intervals and the array compared to it's previous state to find any units which have not responded to the UDP broadcast sequence, implying that either communication has failed for serious reasons or a packet has simply been dropped.
Any lost IPs are then passed to a function which attempts TCP to each in turn, in order to get confirmation of any communication problems.
However I have found in testing that a TCP connection that fails can take up to 30 seconds to return an exception, so in a worst case situation it could take 8 minutes for my app to notice that all 16 units have gone offline.
From long research it seems to me that my only solution is to rewrite large amounts of code to use a sockets implementation instead of a TCPClient, but can anyone think of a way which would save a large rewrite?
|
|
|
|
|
RGVChris wrote: However I have found in testing that a TCP connection that fails can take up to 30 seconds to return an exception, so in a worst case situation it could take 8 minutes for my app to notice that all 16 units have gone offline.
So you're checking each unit, one at a time, using the same thread?? Why not create a seperate thread, per unit, to verify this? Then, all of the tests run concurrently.
RGVChris wrote: but can anyone think of a way which would save a large rewrite?
No matter what, you're going to end up rewriting a large chunk of code, it's just a matter of how large.
|
|
|
|
|
How about:
Dim client As New TcpClient(IpAddress, Port)
client.SendTimeout = 5000
alex_nel
|
|
|
|
|
alex_nel wrote: How about:
Dim client As New TcpClient(IpAddress, Port)
client.SendTimeout = 5000
That was what I thought, but it seems that only affects the timeout of messages being sent, not the initial timeout at [client.connect]
I dont understand why MS didnt provide a client.connecttimeout property...
|
|
|
|
|
|
Help you with what?? You haven't asked a question.
|
|
|
|
|
Dave Kreskowiak wrote: Help you with what??
Duh, he is waiting for his code. Call him master/boss/sire while you're at it.
|
|
|
|