|
Could you try and explain a little clearer, what it is that you are trying to do?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Obviously, you have to send the return character if you want it to change the focus. Perhaps what you need is to understand the answers being given enough to understand that setting the focus of the next textbox is your solution, and that when you're given a solution, you should explore/try to understand it, instead of saying 'do you have another idea', which equates to 'give me another snippet I can try to use without learning anything'.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
woca4u wrote: I try to make virtual keyboard
If you are trying to make a virtual keyboard , you can directly send the keys to the system , instead of sending it to a specific textbox , For sending key to current active application use SendKeys.Send()
built in VB. Also it you want to send the key directly to OS use kybd_event win32 API (using Win32 API is bit tricky), Let me know your choice , if SendKeys.Send() works for you its ok , other wise we can think of using Win32 API
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
This is code
Dim xlApp As New Excel.Application()
xlApp.Visible = True
xlApp.UserControl = True
Dim xlWorkBook As Object = xlApp.Workbooks
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
xlApp.Workbooks.Add()
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI
xlApp.Visible = True
xlApp.UserControl = True
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim i As Integer
Dim j As Integer
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add
xlWorkSheet = xlWorkBook.Sheets("sheet1")
For i = 0 To RabotniciDataGridView.RowCount - 2
For j = 0 To RabotniciDataGridView.ColumnCount - 1
xlWorkSheet.Cells(i + 1, j + 1) = _
RabotniciDataGridView(j, i).Value.ToString()
Next
Next
xlWorkSheet.SaveAs("C:\vbexcel.xls")
xlWorkBook.Close()
xlApp.Quit()
releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)
MsgBox("You can find the file C:\vbexcel.xls")
but when I try export to Excel give me this errror "Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"
Have some ideas?
|
|
|
|
|
Did you import all the proper office references?
Why not write to CSV that way you don't need to worry about Excel?
Which line does the error occur on?
|
|
|
|
|
How to write to CVS have You some code. This code who I give above work when I change regional settings in English(USA) but my regional settings is Bulgarian
|
|
|
|
|
using (StreamWriter MyFile = new StreamWriter(Application.StartupPath+"\\output.csv"))
{
for (int i = 0; i < dataGridView1.RowCount; i++)
{
stLine = "";
for (int j = 0; j < dataGridView1.Rows(i).Cells.Count; j++)
{
stLine = stLine + grdResults.Rows.Item(i).Cells.Item(j).Value + ",";
}
MyFile.WriteLine(stLine);
}
MessageBox.Show(Application.StartupPath.toString()+"\\output.csv");
}
}
|
|
|
|
|
Can You give me this in VB thanks
|
|
|
|
|
You should be able to convert it fairly easily...I'd rather just end this thread
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim stline As String
Dim MyFile As New StreamWriter(Application.StartupPath + "\\output.csv")
Dim i, j As Integer
For i = 0 To DataGridView1.RowCount - 1
stline = ""
For j = 0 To DataGridView1.Rows(i).Cells.Count
stline = stline + DataGridView1.Item(i, j).ToString + ","
MyFile.WriteLine(stline)
Next
Next
MessageBox.Show(Application.StartupPath.ToString() + "\\output.csv")
End Sub
End Class
Man my VB is out of date..
|
|
|
|
|
See if this[^] is not the case.
|
|
|
|
|
see above I use this but again not work
|
|
|
|
|
I am trying to send an email from a Vb.code and the following outlook security warning pops up:
"A program is trying to address emial address....."
How could I overide this security message!!
Thanks,
Aman
|
|
|
|
|
|
I would suggest to use SMTP Client instead of outlook component to send an email using an application
SmptClient is an inbuilt .net class , following is an example of using smptClient to send a email.
Dim smtpClient As New Net.Mail.SmtpClient()
Dim mail As New Net.Mail.MailMessage()
'create the message to be sent
mail.To.Add("test@test.com") ' Enter the Email of the person you want to send the mail to
mail.From = New Net.Mail.MailAddress("username@gmail.com", "Your Display Name") ' Enter Your email address
mail.Subject = "Test Message"
mail.Body = "This is a test message"
' Prepare the client to send the above message
'Attach the file as attachment
mail.Attachments.Add(new System.Net.Mail.Attachment("yourFileName.xls"))
smtpClient.Host = "smtp.gmail.com"
smtpClient.EnableSsl = True
smtpClient.Port = 587
smtpClient.Credentials = New Net.NetworkCredential("username@gmail.com", "password") 'Enter username and password of the account , you want to use to send mail
smtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
smtpClient.Send(mail)
There was a similar question posted
http://www.codeproject.com/script/Forums/View.aspx?fid=1646&msg=2899587[^]
Hope the information is helpful
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
Hi Everybody,
bit of a strange one here, I am not very good with networing tools in .net but are looking at building a firewall i can write and then install on a windows xp/server, i want to setup internet connection sharing on that box with dhcp or my own dhcp server and then issue ip addresses to other machines on the network, any one of the client computers will then try and access the intenet or email, it must then ask them for a username and password i have setup in an admin portals somewhere, it must then log all the bandwidth used by that user and then when they leave i can view a total bandwidth used report for that user on all ports.
If anybody know what assemblies in the .net framework wil help let me know otherwise any other suggestions will be greatly appreciated
I think somekind of a dns interseptor would work but dont know how to handle traffic routing in .net.
|
|
|
|
|
This is the level of what you are trying to do
this is your project
______________
this is your head
Clearly, you are in way over your head.
modified on Thursday, February 5, 2009 1:47 PM
|
|
|
|
|
What you're describing is a proxy server, not a firewall.
There are various proxy protocols you have to implement in your server, plus a rather deep knowledge of TCP/IP and Sockets would be required to pull this off. Forget the Internet Connection SHaring and DHCP Server stuff. They have nothing to do with the ultimate goal of the project (as you described it anyway). Leave the DHCP stuff to an off-the-shelf implementation. One even comes with Windows Server.
The .NET classes are pretty much all going to be under System.Net. What you use depends on the design of your server. Warning: This project is going to require advanced skills in networking and socket communications.
GDMFSOB wrote: I think somekind of a dns interseptor would work but dont know how to handle traffic routing in .net.
Nope. This requires that you configure any software that's going to use the outside network to go through your proxy server. There is no "intercepting" anything to get this to work. Clients can very easily try to connect to outside networks and systems without using DNS at all, so intercepting DNS requests does you no good.
|
|
|
|
|
I have listbox with the follwing data from the base:
rownumber,a1,a2,a3,a4,a5,a6
1 1,2,3,6,5,4
2 3,2,9,5,7,5
3 4,5,2,8,9,7
4 9,9,8,2,3,5
5 9,8,5,1,2,4
6 7,3,6,8,4,9
etc,etc,etc
I have 2 textbox
textbox1 = the 3rd data in 2nd row
textbox2 = the 5th data in 4th row
How do I get these by code?
can someone help?
Tahnks
jaakinye
|
|
|
|
|
Simplest way would be to loop through each item in your listbox collection , since it is comma delimited (each char) it should be easy enough to get substring that you want.
|
|
|
|
|
If you know which item you want to get, then you can use ListBox.Items collection. You need to pass the index of the row you are intersted. After getting that value you can split the value using Split method and providing the separator, which will return the string array. Then you can grab the intended the value.
C#:
textBox1.Text = listBox1.Items[1].ToString().Split(new char[] { ',' })[2];
textBox2.Text = listBox1.Items[3].ToString().Split(new char[] { ',' })[4];
VB:
textBox1.Text = listBox1.Items(1).ToString().Split(New Char() {","c})(2)
textBox2.Text = listBox1.Items(3).ToString().Split(New Char() {","c})(4)
|
|
|
|
|
Thanks so much
Every thing is working well
jaakinye
|
|
|
|
|
I am trying to write a script that gets the info of all the users that exist on a PC. It gathers data on local users but not domain users. Any help would be appreciated on this matter. Here is a copy of my script:
'A Windows Script For Listing all Users on the current box
'Create a WMI Object
Set ow = GetObject("WinNT://.")
strOut = ""
'Get User Array
ow.Filter=Array("User")
For Each obj in ow
strOut = strOut & obj.Name & vbnewline
Next
Set ow = Nothing
Dim oFilesys, oFiletxt, sFilename, sPath
Set oFilesys = CreateObject("Scripting.FileSystemObject")
Set oFiletxt = oFilesys.CreateTextFile("c:\BeaconTemp\userlist.txt", True)
sPath = oFilesys.GetAbsolutePathName("c:\BeaconTemp\userlist.txt")
sFilename = oFilesys.GetFileName(sPath)
oFiletxt.WriteLine(strOut)
oFiletxt.Close
|
|
|
|
|
Here's [^] a bunch of scripts dedicated to User management, including searching AD. You'll find that the code is a bit different for AD than it is for local accounts.
|
|
|
|
|
I have a program that on the main form, I have a toolstrip and I want when you select tsiVersion (menu item), it displays a list of all the mdb files in a certian directory, like all open windows on a window menu.
Thanks in advance
In the end we're all just the same
|
|
|
|
|
First add a OpenFileDialog to your project and call it with the appropriate settings such as:
With OpenFileDialog1
.InitialDirectory = sDefaultDirectory
.Filter = "Access Database (*.mdb)|*.mdb"
.ShowDialog()
End With
Hope this helps.
Dominick
|
|
|
|