|
thanks mate, if i am done i will post it as an tutorial for others... its in VB.net
|
|
|
|
|
Sounds like you need more than a forums resource is going to give you. Do you want someone to write this for you or are you expecting to pick up and Express version and create the program from scratch yourself.
Try rentacoder for the writing and you will need a lot more knowledge to begin creating it yourself, try a book(s) or simple examples first.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I don't know about that, some applications like that already exist I'm sure it wouldn't be too too difficult....
|
|
|
|
|
EliottA wrote: I'm sure it wouldn't be too too difficult
Possibly but I think you have the wrong forum for the request, that was my point, CP will help you learn how to develop the code, I will be surprised if anyone here will write it for you.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Sorry for the misunderstanding, I didn't know he was looking for someone to code it in its entirety for him. I thought he was just... I don't even know.
apologies.
|
|
|
|
|
Oops - those comments were meant for the OP .
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i just need a link for tutorial or so i can do it myself further on.
Not in a hurry or so...
well, i want to do some like this:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Text.RegularExpressions;
namespace cssrcon
{
public class rcon
{
public byte[] prepareCommand(string command)
{
byte[] bufferTemp = Encoding.ASCII.GetBytes(command);
byte[] bufferSend = new byte[bufferTemp.Length + 4];
bufferSend[0] = byte.Parse("255");
bufferSend[1] = byte.Parse("255");
bufferSend[2] = byte.Parse("255");
bufferSend[3] = byte.Parse("255");
int j = 4;
for (int i = 0; i < bufferTemp.Length; i++)
{
bufferSend[j++] = bufferTemp[i];
}
return bufferSend;
}
public string sendRCON(string serverIp, int serverPort, string rconPassword, string rconCommand)
{
UdpClient client = new UdpClient();
client.Connect(serverIp, serverPort);
string getChallenge = "challenge rcon\n";
byte[] bufferSend = this.prepareCommand(getChallenge);
IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
client.Send(bufferSend, bufferSend.Length);
byte[] bufferRec = client.Receive(ref RemoteIpEndPoint);
string challenge_rcon = Encoding.ASCII.GetString(bufferRec);
challenge_rcon = string.Join(null, Regex.Split(challenge_rcon, "[^\\d]"));
string command = "rcon \"" + challenge_rcon + "\" " + rconPassword + " " + rconCommand + "\n";
bufferSend = this.prepareCommand(command);
client.Send(bufferSend, bufferSend.Length);
bufferRec = client.Receive(ref RemoteIpEndPoint);
return Encoding.ASCII.GetString(bufferRec);
}
}
}
but in VB not more not less.
the only thing else is i need to get the variables from the reicived text
|
|
|
|
|
hey, you send a answer to me about sending commands...
well i am truely not the best in VB.Net i have visual studio express 2008...
i want to build an editor for some script(called eventscripts) its not flash, no you can find it @
|
|
|
|
|
existing ones are in C++ and thats too difficult for me...
i know little bit C# and more VB.NET
http://www.codeproject.com/KB/game/csRcon.aspx[^]
is some example in C# but i need to use these commands in VB.NET so i made a csrcon.cs to a dll from the C# project, but it doesnt do all i need.
i need to write, receive variables so it could be auto-set for users.
|
|
|
|
|
hey friend there is some example but it doesnt seem to work for counter strike source game...
its made for older game, with same commands. so i dont know whats up.
here is link: http://www.codeproject.com/KB/game/csRcon.aspx[^]
i want to make it in VB, i made the csrcon.cs (the byte send file, into a .net .dll so i can use it in VB ..;) but i dont know how to make something that would get variables out of the received text
greetings
|
|
|
|
|
hi dear,
i've a function that makes corners of a picture round which is written below...
Code:
Public Function RoundImage(ByVal img As Image, ByVal radius As Integer) As Image
Dim bmp As New Bitmap(img.Width, img.Height)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim z As New GraphicsPath()
Dim r As Integer = radius
Dim d As Integer = r + r
Dim w As Integer = bmp.Width
Dim h As Integer = bmp.Height
z.StartFigure()
z.AddArc(0, 0, d, d, 180, 90)
z.AddArc(w - d - 1, 0, d, d, 270, 90)
z.AddArc(w - d - 1, h - d - 1, d, d, 0, 90)
z.AddArc(0, h - d - 1, d, d, 90, 90)
z.CloseFigure()
g.SetClip(z)
g.DrawImage(img, 0, 0)
Return bmp
End Function
it is working well. the problem is that when i apply this image as wallpaper, black color appears at corners... whereas the corners should be transparent...
im using the following function for setting the image as wallpaper...
SystemParametersInfo(20, 0, imagePath, 1)
a sample image is attached...
thanks in advance
|
|
|
|
|
I'm guessing that the bitmap you use to initialise the graphic object is created as solid black (i.e. all zeros). Therefore to make it transparent you have to set the source of the graphic to start as transparent.
|
|
|
|
|
Also, the BMP format doesn't support transparency.
|
|
|
|
|
Hi guys,
I am not sure if this should be VB specific or more design but i'm a bit stuck with a dll i try to write. This dll should take care of communication with our server (tcp) and download files. Then this dll can be used by various host applications that need connection with our infrastructure. Now i want to build a download queue which in the back is downloaded ( backgroundworker ) and where i can add downloads selected by the app (it's about music and video files). This "queue" needs to be exposed to the host application so they can see the queue and what is happening..
However.. first i thought of doing this using our database ( we use sqlite for the communications DLL).. however.. sqlite and multithreading don't get along AT ALL.. so this locked the database giving all sorts of evil errors (and worse.. sometimes blocked the TCP Socket from writing data into the local database which takes priority over the downloads
Then i wanted to do this using a datatable but this too gives all sort of strange issues which just seem to send me in a loop (exposing the queue using a dataview.. the connected datagridview doesn't refresh as it should, when row is selected that is downloaded and then gets removed from the view we get "isnull" errors etc, etc, etc)
Now my ideas are out and i turn here:
What is the best way to build a download queue which:
Needs to be able to prioritized
needs to be visualised like our background thread is using it (so with the priority in place)
Where multiple threads can add / remove downloads from it..
Can anyone point me in a right direction ?
Many thanks !
Do Or Don't, there is no "try catch ex as exception end try"
modified on Sunday, December 28, 2008 9:42 AM
|
|
|
|
|
It sounds like you need a priority queue and a way to retrieve some status information from it. It also sounds like you have the priority queue in place. Use locking for queue access and modification. I'm a C# developer and don't know the VB.NET syntax, but in C# there's the lock keyword that can be used to lock a section of code for execution by a single thread. It's pretty simple and the most common technique is to create a locker object that is locked in every place the queue will be touched. Depending on your needs you may want to go with a subscriber model to provide information to other applications. With it you would have queue modification events that other applications 'subscribe' to and they would implement an event handler that will give them an EventArgs object with information about the event (ItemAdded, ItemRemoved, ItemUpdated, ItemProcessed, etc.). Or, perhaps you want to go with a by-request model in which you have methods that return a status object only when invoked. Using .NET Remoting may be useful if it is a Client-Server architecture as the TCP/IP communication is already handled for you and it defaults to using a Singleton, where one instance of the priority queue will exist on the server and clients can interact with that instance remotely.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi,
I am trying to create a VB.NET application which can open a browser and login using a username and password from the application. And then after login use it to search for values passed by the application.
Can this be done??If yes how can yo just give me the code to open browser and pass values.
thanks for your help.
Shrey
|
|
|
|
|
I won't give you any code, but you could take a look at the WebRequest, WebClient and other related classes in the System.Net namespace. I think these will do what you want without having to open up a browser window.
|
|
|
|
|
I beleive there may be an article here for scraping web sites, that should get you started.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dose anyone have any code that will allow me to change the backgound color of a Windows Mobile Toolbar in VB.
Thanks in advance as I know this code can only be wrote by the pro's.
Mark
|
|
|
|
|
Hi!
I'm trying to run a process that updates a zip/tax rate table.
The new tax rates are in a flat file. the table I need to update is a FoxPro free table indexed in country and zipcode fields.
Everything is working, but I have 45K+ records to update and after about 15% into the flat file the process it gets slooooow and gets slower and slower.
If I comment out the code that does search and just leave the code that goes through the flat file it takes about 30 seconds with the looks up and update it takes 30+ minutes and I can see the progress bar miving for first 15% and than it dies.... I think I am missing something here...
Here is what the code looks like:
m_conn = New OleDbConnection
m_conn.ConnectionString = "Provider=VFPOLEDB.1;" & _
"Data Source=" & g_app_options.processing_folder_path & "output\tax import;" & _
"Mode=ReadWrite|Share Deny None;" & _
"Collating Sequence=MACHINE;"
m_conn.Open()
Do While srTaxFile.EndOfStream = False
ado_command = New OleDb.OleDbCommand("SELECT ZIPCODE FROM zip WHERE country='001' AND ZIPCODE='" & taxRecord.field(cTaxRecord.RecordFieldIDs.ZipCode).Trim & "'", m_conn)
Dim sZipCode As String = ado_command.ExecuteScalar()
ado_command = New OleDb.OleDbCommand("UPDATE zip SET itaxr = " & taxRecord.field(cTaxRecord.RecordFieldIDs.SalesTaxRate).Trim & " WHERE zipcode='" & taxRecord.field(cTaxRecord.RecordFieldIDs.ZipCode).Trim & "'", m_conn)
ado_command.ExecuteNonQuery()
set_progress(srTaxFile.BaseStream.Length, srTaxFile.BaseStream.Position)
Loop
Its pretty simple, and I don't understand why it takes that long. This is running on a local drive.
If you can help or know what I'm missing, I would greatly appreciate it!
Thank you
ipokrov
|
|
|
|
|
Sorry but are you trying to update a table based on values from a flat file? Also, why are you selecting first if you know what you want to update?
You should also look at Transaction--this might make the process faster but I am sure there are better ways to do what you need to do. Can you please explain what you want to do, in plain English, without any code?
|
|
|
|
|
Hi,
Sorry I was not clear on what I'm trying to do.
In plain English, I have a comma delimited file with 45k+ records that contains zipcode and taxrate. I have a foxpro table that contains countrycode, zipcode and taxrate fields. Now I need to update each taxrate field in the table with value of taxrate field from the flat file. If the zipcode in taxrate table is not found I need to insert a new record. (that is why I have to lookup the zipcode first, I commented that code out and did not include it with my example.)
Thank you
ipokrov
|
|
|
|
|
|
FoxPro has indexing on it's tables using either IDX or CDX files, they'll have the same name as the .DBF file, but with a different extension; that is if there are any indexes on the table. Hopefully, there is an index on the zipcode field that can be used to speed up the look up queries. From my experience with OLEDB, it's generally faster to send as few commands as possible, so build a single query like:
select zipcode from zipcodes where zipcode in (... comma-separated list of zip codes ...)
This query of course will perform much better if there is an index on the zipcode field. It will give you the list of zipcodes that exist and need to be UPDATEd and ones that aren't in the result set will be INSERTs.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Hi All...
I am trying to load xml file with code mentioned below.
Dim XMLDc as XML.XMLDocument
XMLDc.Load(file.Path)
The problem in above is some file is getting uploaded where as xml file is not. It gives error 'Check the path' where all file is in same folder.
Say the path is "D:\Project" there is 3 files 1.xml, 2.xml, 3.xml
1.xml & 3.xml is getting uploaded and 2.xml is not. Generate Error 'Check the path and file should exist'
Please explain me the error and how to solve it...
Thanx in advance...
Shazz here to help you...
|
|
|
|