kaanuki's Q&A profile
Visual C++ Running thread as a different user
Hi, I am trying to an application which runs as Local System user. I want to spawn a thread which executes a particular function as a Run As user. Is it possible Thanks, Sushanth I don't really have a sample so I would have to look at those sites myself to find samples and such. Since this is outside the scope of this forum, it is better for you if you get help from a site in which people experienced with the subject are more likely to help. Someone might provide you a sample here but it is better for you to get a sample from a site in which SDK security is appropriate. For one thing, for this subject, a sample might not be enough; I think it is necessary to learn about security to be able to get something such as this to work. ...Show All
Visual C# Streaming voice over UDP
I want to transfer voice via sockets using UDP protocol. I capture voice with DirectSound to SecondaryBuffer. Because UdpClient doesn't have streams, I can't stream this buffer. what can I do How to send voice Just split up the data in SecondaryBuffer into chunks of byte[] suitable for sending with UdpClient.Send(). Put your buffer together again at the receiving end to play it back. You'll need to add a header to the byte[] so you can detect UDP datagrams getting dropped or getting received out of order. A simple block counter should do the trick. Test your code, and the effect it has on playback quality, by randomly dropping datagrams. ...Show All
.NET Development Logging using Attributes
I would like to log method execution in text file. I would like to use custom attribute to mark such method, but I don't know how to use custom attribute to run code before and after method execution Is that doable This is possible using reflection, although the end probably won't justify the means. At first glance it seems that it wouldn't be acceptable for any serious usage. An example of using a custom attribute to invoke a method can be found here: http://www.yoda.arachsys.com/csharp/benchmark.html . It also shows you how to perform pre- and post- processing when calling the method. Is the tracing provided by .Net not acceptable Enterprise Library also provides a tracing alternative. You might also try looking fo ...Show All
Visual Basic read binary data stream from com port, write to file between certain characters
I am new to using vb.net with binary and com ports and have a project where I need to monitor com5 for a binary data stream that I will receive every 5 minutes from a sensor. The data stream starts with "cs" and ends with "end" and I want to simply save the binary data that falls between these characters as a file with a ".000" extension. The "cs" and the "end" cannot be in the resulting file. I wasn't sure about removing "cs" and "end" since the data is in binary. Do I need to convert the entire binary stream to ascii and test for the "cs" and "end" then convert back to binary before saving Does anyone have a code snippet or suggestion on how I sh ...Show All
Visual Studio Express Editions Determining FileSize
ok I use FileOpen to open a file, and the files that I need to open are of a specific size, and any bigger/smaller and it will cause the game to crash. It is for Populous, the header files. Here is my code: Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myFile As String = "" Dim Dr As DialogResult = OpenFileDlg.ShowDialog If Dr = Windows.Forms.DialogResult.OK Then myFile = OpenFileDlg.FileName 'hfile = New String(Chr(0), 616) hfile = New String (Chr(0), 616) FileOpen(1, myFile, OpenMode.Binary) FileGet(1, hfile) If hfile.Length <> 616 Then FileClose(1) MsgBox( "Invalid File! ...Show All
Visual Studio 2008 (Pre-release) Notify changes od the bd
Hi, I worked with WinFS and an interesting thing of this was that the changes in the file system(bd) was notify to the application, example: when I add a new object Person in de file system (BD), the object of the class watcher notify that one object was added in the bd In ADO .NET Entity Framework will have this function If not, why do I do this Thank you!! Hi, thank you!! The changes in the bd must be notify to the application. if another application introduce a new row in table person of the sql server, ADO .NET Entity Framewrok must throw an event refering to an object person is added. This made in WinFS By!! ...Show All
Visual C# Looking for info on filehandling
I am looking for some good info on file IO with visual C#, i'm a log-file maniac and among other things i want to dump all the textboxes into a plain textfile. I'm also looking for info on how to interact with a printer. Any info will be helpful, thanks, .NET has a printer class which you can use and print to the printer. Many examples here on the forums on how to do this. http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.print.aspx in regards to textfiles, take a look at how to write to a file: http://msdn2.microsoft.com/en-us/library/system.io.streamwriter.aspx (also scroll down right to the bottom and there are links there on how to write to a file) alternatively if y ...Show All
Visual Studio Cannot Download Visual Studio 2005
Hi, I am trying to download the visual studio 2005 trial for 90 days. The link provided by microsoft is : http://www.microsoft.com/downloads/info.aspx na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=B2C27A7F-D875-47D5-B226-E2578A116E12&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fe%2f0%2f4%2fe04de840-8f6b-4fe5-ac3d-d3ad8e4c2443%2fEn_vs_2005_Pro_90_Trial.img the Img file is download wighin milliseconds. But actual size shown was 2.4 GB. What is this image file or any tool is there to run this file.. Thanks Mohan it should download ok, looks like something is blocking you from downloading it. Tried disabling your AV software just in case to see if this could be one cause of the problem ...Show All
Visual Studio Express Editions Building a command line application
Hi, finally looking at VB2005 as I'd like to build a .exe that can be run from a command line. The code I have is this: Module Module1 Sub Main() FileSystem.FileOpen(1, "H:\Research\GetWebFile\x.x" , OpenMode.Output) FileSystem.Write(1, "Hello World" ) FileSystem.FileClose(1) End Sub End Module I built it without any errors, but when I run it I get the error : The assembly or AppDomain that failed was HelloWorld, Version 1.0.0.0, Culture=neutral, PublicKeyToken=null Can anyone help explain what is wrong. Do I need to create a form, I have set the startup object as Sub Main, There is nothing else to choose from Do I need to add a reference to something TIA, Chip ...Show All
Windows Forms Database Woes!!!!
I am trying to enter data collected by an I/O card connected to the computer into a database. I have a data set and table adapters, no problems there. I can add the rows one at a time while the data is collected, to the dataset and when a specific number of new rows(in this case 25) has been reached the data set is appearently sent back to the database with a call to the Update() method in the table adapter. A text box displays the total number of affected rows i.e. 25. The problem is that when I view the table data in the database explorer my new rows are not in the database. As far as i can see I have all the neccessary code to save the rows and that they have been saved successfully but alas they are not there!! please help. Me . ...Show All
Visual C# Refresh Property Grid Values
Sorry, but I had to repost this in the C# forum because no one answered me in the Windows Forms forum. Say I have an object, "oFoo", and I assigned oFoo to a PropertyGrid on my form. oFoo also has a .CurrentValue property. If I have a TrackBar (tBar) on my form, and when the user scrolls the TrackBar, oFoo's .CurrentValue is updated respectively. How do I refresh the CurrentValue so that it shows up correctly in the PropertyGrid Right now, the only way I can do that is by refreshing the entire PropertyGrid, but I would think there would be a better, more standard way of doing this. I've tried using RefreshProperties(RefreshProperties.All), but it doesn't even refresh the value in the property grid, so I'm pretty stuck ...Show All
Visual Studio how to make a big application go faster
Hello everyone, My app is getting big, and now it is slow in debugging time. Do you know any tricks to make it go faster Thanks in advance. Hello creaturita , In order for us to provide assistance we are going to need more information from you regarding yoru application. Take a look at the Debugger FAQ's. Perhaps you will find the answer to why your application is runing slow. At the very top it will list the set of things we need to move forward. Thank you, Liz ...Show All
Visual Basic Iterating through a panel's control collection
Greetings: I've got a panel (pnlExpenses) with several labels and textboxes on it. I want the program to go through the dollar amounts entered in the textboxes and put the subtotal in a class level variable (dcSumOfExpenses). However, when the debugger passes through this Sub, objControl always shows a value of Nothing, and the Count of pnlExpenses.Controls always shows a zero. What is my code missing The panel was added to a tabpage at design time, and the labels and textboxes were laid on top of the panel. Do I need to do something more to establish the panel's controls as a collection Private Sub SumExpenses() dcSumOfExpenses = 0 Dim objControl As Control For Each objControl In pnlExpenses.Controls ...Show All
Visual Studio 2008 (Pre-release) Visual Brush confusion.
Greetings. I have an application with a main window with a grid and 2 columns. In each column is a rectangle, thus: <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Rectangle x:Name="Rect1" Grid.Column ="0" Grid.Row="0"/> <Rectangle x:Name="Rect2" Grid.Column ="1" Grid.Row="0"/> </Grid> I also have a very simple user control, thus: <UserControl x:Class="VisualBrushTest.TestUC" ...Show All
Visual Studio Express Editions Currency Textbox Like In Visual Foxpro
I Want a Currency Text Box Line In Visual Foxpro That only Accept Numeric Values in Visual Foxpro Numeric Textbox Has Fixed 0.00 how do like this in vb.net 2005 This will work just fine for accepting numeric or control characters such as delete. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress ' textbox1 just accept numeric data or control characters such as delete, backspace If Char.IsDigit(e.KeyChar) Then e.Handled = False ElseIf Char.IsControl(e.KeyChar) Then e.Handled = False Else MessageBox.Show("plz click numbers only") e.Handled = True End If End ...Show All
