encrypting/ decrypting xml based dataset with RSA
My webdatabase has RSA encrypted Credit Card info which i download to
my windows app via a webservice. A dataset in the windows form code
then decrypts the data with a private key and displays on the form.
I want to create a cached version of the data in xml, therefore the cc
data has to be re-encrypted before it is saved to the local drive. To
do this I have both pub and private keys with the user app on their
PC's. This is where i seem to have a problem as when the data is
re-encrypted it changes.
My encryption/ decryption code is as follows:
###################################################
Function RSADecrypt(ByVal instring As String) As String
If instring.Length > 0 Then
Dim RSA As RSACryptoServiceProvider = New
RSACryptoServiceProvider(1024)
Dim sr As StreamReader = New StreamReader("RSAKeyPriv.xml")
Dim s As String = sr.ReadToEnd()
sr.Close()
RSA.FromXmlString(s)
Dim inp As Byte() = Convert.FromBase64String(instring)
'This always throws an exception "invalid key" :(((
Dim outp As Byte() = RSA.Decrypt(inp, False)
Return System.Text.Encoding.Unicode.GetString(outp)
RSA.Clear()
Else
Return instring
End If
End Function
Public Function RSAEncrypt(ByVal instring As String) As String
Dim RSA As RSACryptoServiceProvider = New
RSACryptoServiceProvider(1024)
Dim sr As StreamReader = New StreamReader("RSAKeyPub.xml")
Dim s As String = sr.ReadToEnd()
sr.Close()
RSA.FromXmlString(s)
Dim inp As Byte() = System.Text.Encoding.Unicode.GetBytes(instring)
Dim outp As Byte() = RSA.Encrypt(inp, False)
Return Convert.ToBase64String(outp)
RSA.Clear()
End Function
###############################################
my dataset manipulation to decrypt the data so it can be displayed on
the form is as follows:
#################################
Public Function SyncOrderHeader() As DataSet
Try
dsH = ws.SyncOrderheader
If File.Exists("orderheader.xml") Then
Dim cache As New DataSet
cache.ReadXml("orderheader.xml")
' synchronize the data with cached file
If (cache.HasChanges()) Then
dsH.Merge(cache.GetChanges())
'ws.UpdateCustomers(dsH)
dsH.AcceptChanges()
File.Delete("orderheader.xml")
End If
End If
Catch er As Exception
MessageBox.Show(er.ToString)
online = False
StatusBar.Text = "Working in offline mode"
' try to get the data from the cache file
If (File.Exists("orderheader.xml")) Then
dsH.ReadXml("orderheader.xml")
End If
End Try
Try
dsH.Tables(0).TableName = "OrderHeader"
Dim r As DataRow
For Each r In dsH.Tables(0).Rows
r.Item("cc_Type") = RSADecrypt(r.Item("cc_Type"))
r.Item("cc_OwnerName") = RSADecrypt(r.Item("cc_OwnerName"))
r.Item("cc_ExpiryDate") = RSADecrypt(r.Item("cc_ExpiryDate"))
r.Item("cc_StartDate") = RSADecrypt(r.Item("cc_StartDate"))
r.Item("cc_SecDigits") = RSADecrypt(r.Item("cc_SecDigits"))
r.Item("cc_IssueNumber") =
RSADecrypt(r.Item("cc_IssueNumber"))
r.Item("cc_CardNumber") = RSADecrypt(r.Item("cc_CardNumber"))
Next
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
Return dsH
End Function
##########################################
When my app closes the cc columns in the dataset are encrypted again
using:
###########################################
Dim r As DataRow
For Each r In dsH.Tables(0).Rows
r.Item("cc_Type") = RSAEncrypt(r.Item("cc_Type"))
r.Item("cc_OwnerName") = RSAEncrypt(r.Item("cc_OwnerName"))
r.Item("cc_ExpiryDate") = RSAEncrypt(r.Item("cc_ExpiryDate"))
r.Item("cc_StartDate") = RSAEncrypt(r.Item("cc_StartDate"))
r.Item("cc_SecDigits") = RSAEncrypt(r.Item("cc_SecDigits"))
r.Item("cc_IssueNumber") = RSAEncrypt(r.Item("cc_IssueNumber"))
r.Item("cc_CardNumber") = RSAEncrypt(r.Item("cc_CardNumber"))
Next
###########################################
Any ideas why this wouldnt work? Tag: OT: Find pattern in sound Tag: 106321
Digital Signatures
I`m looking for resources about digital signatures using .NET, (books,
articles etc).
Tanks Tag: OT: Find pattern in sound Tag: 106320
Security settings for intranet zone
Hi,
I have a problem executing a managed application from a server's share -
hopefully, someone can give me a hint. The application and all DLLs are
signed with a key, therefore have a strong name.
Now, I was assuming that if I create a code group under the
"Organization" level with that strong name as criterium and the
FullTrust permission set, my assemblies should be able to access all
ressources (including reflection which is causing all the trouble); but
when executing the application, I get a SecurityException. I tried
setting that policy to LevelFinal and Exclusive, but still that nasty
SecurityExceptions keep popping up. The only way I found to make it work
is when I set the LocalIntranet zone security setting to the highest
level. But of course, customers will not be wanting to grant full access
to just any assembly on the intranet.
Therefore, my questions are:
1. How does the zone security setting affect the runtime policies?
2. How can I grant my application FullTrust permission set, but only my
application?
Thanks for any hints on this!
Roland Tag: OT: Find pattern in sound Tag: 106317
Win32Exception on calling myProcess.start() method
Hello,
Probably this question has been asked yet, but I can't find any answer
to my problem.
I have an ASP.NET application, which call a method which has to launch
a batch. To do it, I use an instance of the Process class. But when I
try to execute the start() method of this instance, it throws an
exception : " Win32Exception (0x80004005): Access is denied"
I think there is a way by using the System.Security.Permissions
namespace, but I can't find how to do it.
For information, when I change the identity of the pool which support
this application in IIS and set it to an administrator, it works ...
but I'd prefer not to do it ;)
many thanks Tag: OT: Find pattern in sound Tag: 106316
Distributing .NET Framework 1.1 SP1
Hi!
I am about to distribute .NET Framework 1.1 SP1 to a bunch of clients. I
thought that there were a redist version of the framework including SP1, but
after looking around this doesn't seem to be correct.
Can someone verify this?
My conclusion is that i have to dist .NET Framework 1.1 (dotnetfx.exe) as
well as SP1 (NDP1.1sp1-KB867460-X86.exe)?
--
/JockeB - Developer Tag: OT: Find pattern in sound Tag: 106306
Is it a BUG in C# compiler ?!!!!
Hi All.
I faced with strange behavior of C# compiler - in some cases it generates
not working code!
I mean code that lead to the exception - System.InvalidProgramException:
Common Language Runtime detected an invalid program.
The situation is following - 3rd vendor library generates a class that
contains too big InitializeComponent method (copy-paste of
InitializeComponent method to empty text file gives us 23.100 lines and size
= 1.9mb). When calls this method is called application immediately crashed
with the message - "System.InvalidProgramException: Common Language Runtime
detected an invalid program."
Content of InitializeComponent is similar to such methods in Windows.Forms
or Asp.Net application - there are initializations of components properties
ans so on - nothing special, just lot of assignments; no local variables -
ony class members used.
Just by a guess I tried to split up that method to more small pieces of
code - InitializeComponent1, InitializeComponent2 and so on. After that
mentioned error disappeared - all things begin to work fine.
I tested this case on 3 different computers - this error is stable (btw, I
my computer is Pentium4-3GHz/1Gb RAM/120Gb HDD, then I do not think that
error could appears because of weak computer).
One more case I tested - Debug and Release builds of that application -
mentioned error appears constantly only in Debug build, Release build of the
application works fine.
And one more interesting thing - this error stable appears in VS.Net 2003
and VS.Net 2005 Beta2.
Then is could be a problem of new VS.Net too.
My questions are:
Is it a BUG in C# compiler? Is it limitation of compiler? Where such
limitations described?
Should I think my conclusion about reason of this error (I mean - too many
code in one class method) is correct?
Or perhaps you could see any other possible reasons of the problem? Which?
Could we expect Microsoft to release the patch in the nearest future?
Or should we ask 3rd vendor to implement the workaround I found (I mean -
splitting up big method to smaller)?
The problem is very serious for us, please help!
WBR,
Dmitry. Tag: OT: Find pattern in sound Tag: 106305
Another Obsolete method RegisterClientScriptBlock
The replacement is .ClientScript.RegisterClientScriptBlock(type as
<type>,key as <string>, script as <string>)
What is the type parameter looking for? There is no enumerated list and
documentation is no help.
Thanx,
--
- Robert Beaubien
- President
- Kool Software
- Tag: OT: Find pattern in sound Tag: 106298
Configuration Obsolete method
My converted application is generating warnings for the following line, but
I can not find any system.configuration.configurationManager.AppSettings
items. What am I missing?
SqlConnection1.ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionPrimary")
Warning 13 'Public Shared ReadOnly Property AppSettings() As
System.Collections.Specialized.NameValueCollection' is obsolete: 'This
method is obsolete, it has been replaced by
System.Configuration!System.Configuration.ConfigurationManager.AppSettings'
D:\VS2005\Projects\NVC\NVCArmls\ArmlsDAL\ArmlsUsers.vb 22 43 ArmlsDAL Tag: OT: Find pattern in sound Tag: 106295
Dumbass Dependancy Chain
Hi
I cant install .Net 2.0 because of an error with the Windows 3.0 Installer,
this in turn means i cant install Sql Server 2005 Express Edition. Does
Microsoft seriously expect that Im going to open myself up to this kind of
bullshit dependancy chain for every copy of my software I sell? Not likely.
Seems to me the support costs of this 2.0 model alone would eat through any
profit I might make. Maybe those VB6ers do have a point.
TM Tag: OT: Find pattern in sound Tag: 106292
TextWriterTraceListener
I'm using the TextWriterTraceListener that is configured via an app config
file. This works great when there's only 1 instance of the applciation
running. If there are more than 1, then I get an access denied because
another process has the file locked. I could add the
TextWriterTraceListener in code at runtime and specify a unique file name
but I was hoping to keep the configuration in the app config file. What is
the best way to handle using the TextWritrTraceListener in this scenario?
Thanks,
Eric Tag: OT: Find pattern in sound Tag: 106289
Communication via IPC
Hello,
I've been reading up on IPC and looking at sample code, and I can't seem to
figure out how to actually accomplish communication from a client to a
server. I understand the concept of a server hosting a dll which contains a
method that the client can call. However, how can the server also obtain a
reference to the same object? I want the client to be able to send a message
that makes it to where the server can use it.
To clarify my question, the examples I've seen so far have been like this:
Server creates a channel exposing Class A.
Class A contains a handy-dandy method that can multiply two ints.
Client creates a channel to be able to instantiate a new Class A object and
call its methods.
But how does Client get a message all the way back to Server?
I tried creating a client channel in the server itself, but I can't make
that work. I get an exception saying that there is already a registered
object for that channel. I also tried creating an instance of Class A in the
server, but it was a completely separate object that did not see messages
that the client put into it.
To give some context, I have a Windows service that needs to be controlled
via a Windows Forms app. As I understand it, to get messages to the Windows
service, I would create a channel there and have the Forms app be the client.
But how do I actually retrieve the messages from within the service?
Apparently IPC is the way to go for on-box communication, but I haven't seen
any examples showing how to get a client and server to exchange actual
messages. Please help!
Brian Tag: OT: Find pattern in sound Tag: 106286
DataGrid Troubles
I have used in my c# code a DataGrid in various kinds, but in any cases when
attempt to double click on vertical scrollbar the result is impredictable:
the grid is resized in some strange ways and ther's no way to get back in
the past size.I had analized MESSAGES from controls and didn't appears any
kind of Resizing messages.
Somebody can help me about that trouble ??
Thanks a lot Tag: OT: Find pattern in sound Tag: 106282
ANN: Reminder: Online chat tomorrow regarding Smart Device Programming
Hello!
Just a note that we'll be hosting an online chat tomorrow concerning Smart
Device Programming with Visual Studio. The title on MSDN says Visual Studio
.NET 2003, but now that VS2005 has shipped those questions should be fair
game as well! Members of the development teams (.NETCF, Visual Studio for
Devices and SQL Mobile) will be on hand ready to answer your questions, so
bring 'em on!
November 8, 2005
10:00 - 11:00 A.M. Pacific time
Additional Time Zones:
http://www.timeanddate.com/worldclock/fixedtime.html?year=2005&month=11&day=8&hour=10&min=0&sec=0&p1=234
Chat: Smart Device Programming with Visual Studio .NET
Description: Please join the members of the .NET Compact Framework and
Visual Studio product groups in this live chat regarding the .NET Compact
Framework and the Smart Device Programming features of VS.NET. The .NET
Compact Framework brings the world of managed code and XML Web services to
smart devices, and it enables the execution of secure, downloadable
applications on devices such as personal digital assistants (PDAs), mobile
phones, and set-top boxes. Please come prepared to ask the tough questions!
To join this chat, please log on via the main MSDN chat page at:
http://msdn.microsoft.com/chats
--
Thanks!
Michael Fosmire
MVP Lead, Windows Embedded/NetCF
This posting is provided AS IS with no warranties, and confers no rights. Tag: OT: Find pattern in sound Tag: 106280
Excel Events
Hi Group,
VB.Net I'm displaying the names of the open Excel workbooks in a listbox on
my form. It looks as if it might be possible to monitor Excel's events
(OpenWorkbook in this case) and update my listbox.
If this is possible, could someone could point me in the right direction for
some reading material or provide some code as to how the mechanism works,
that would be great.
Thanks,
Kenneth Hutson
San Antonio, TX Tag: OT: Find pattern in sound Tag: 106278
OutOfMemoryException in service but not in application
I have a C# app which calls the RTC 1.3 API through the interop wrapper.
The app will make a large number of logins for different users.
If I run it as a standalone app, it is fine and that I can make more than
1000 logins.
But if I run as a Windows service, I will get OutOfMemoryException always
around at 420 logins.
System.OutOfMemoryException: Not enough storage is available to complete
this operation.
at RTCCore.RTCClientClass.InitializeEx(Int32 lFlags)
What could be the difference between running as a service and a standalone
app?
Both run under the same user account.
Thanks. Tag: OT: Find pattern in sound Tag: 106274
Routing System for buildings
Hi,
I have got a problem. I want to design something like a navigation/routing
software for a building (like: I am in room A and I want to room E --> route!)
How would you do it or is there a software for that for ASP.NET?
thx
juvi Tag: OT: Find pattern in sound Tag: 106260
Clickonce CreateFileAssociation
Hi,
I don't konw I got the right discussion group, but here goes:
I have a deployment issue with .NET 2.0 and clickonce. My application uses a
few different filetypes, which should be registered so that the application
user can click on them and the files will be opened in the application.
I know that this is not possible by default i clickonce, but is it possible
to use a mix of msi and clickonce or somthing? If so how? Tag: OT: Find pattern in sound Tag: 106258
Visual Studio 2005 Final release and .Net Framework 2.0
Hi,
Where can I get the Visual Studio 2005 Final release and .Net Framework
2.0.
I have a valid MSDN subscription ID from my organisation.
Best Regards,
Sanjeev Tag: OT: Find pattern in sound Tag: 106257
Windows Services, COM objects and user accounts
We have a windows service that runs under SYSTEM which launches a COM object.
Is there any way that an application running under a user account can access
that COM object, and if so, how is it done ? Currently, we get an automation
error whenever the user application attempts to access the COM object.
Many thanks for any help
Cliff Cooley Tag: OT: Find pattern in sound Tag: 106256
.Net and MS Access
How do I invoke an Access report from a .Net program?
My customer has Access 2000 and I have Access 2003. Tag: OT: Find pattern in sound Tag: 106250
.Net Magazines or news resources -- what's popular?
Hi guys,
I'm getting started with learning asp.net framework (decided to go the
C# route), but with Microsoft constantly changing the products all the
time, is there any .Net magazine or resource I can subscribe to to keep
up-to-date with what's going on? Even an emailed newsletter, RSS feed,
anything that'll help me stay in the loop of Microsoft's ideals. Where
do you guys get the latest news and info about these changes?
Just curious --
Sam Tag: OT: Find pattern in sound Tag: 106243
Does Language Matters?
Hello,
I am developing an application on my system which has .NET framewor 1.1
(English) installed. Then I am trying to run the same application on my
another system which has .NET 1.1 (German) installed. Now the problem is
there are few operations with decimal nos. I mean (5.0 + 3.6) and so on...
But these operartions are performed as 50+36 as in europe we use ,(comma) to
seperate nos. Now my problem is how can I make my app universal given these
constraints?
Please help me ASAP... Tag: OT: Find pattern in sound Tag: 106228
Datagrid with checkbox ( multi selection)
Hi,
I trying to create a datagrid that allows multi selection. So I created a
first checkbox column where the user will click selecting the row.
But in runtime, the checkboxes from this column are always disabled.
I tried adding a new column in the datatable and adding a new style
column in the datagrid. The result is always the same.
Thank you,
Roby Eisenbraun Martins Tag: OT: Find pattern in sound Tag: 106222
Sleeping thread problem when closing app
I use Thread.Sleep to cause my background threads to for 500ms. The
structure of the thread is:
do
{
...
-- code --
...
Thread.Sleep(500);
} while (!closing)
Now my problem is that occassionally when my application is exiting it just
hangs and won't close. In my FormClosing event I have the following code:
closing = true;
backgroundThread.Interrupt();
backgroundThread.Abort();
But it doesn't seem to stop the problem. And when the background thread
doesn't sleep the problem doesn't occur, but its not an option because CPU
usage is high if it doesn't sleep.
How do I fix this?
Cheers... Tag: OT: Find pattern in sound Tag: 106221
Combo Box Selected Value changed event Gives Unhandleed exception.
Hey All,
What we are trying to achieve is, when Selected value changed event is fired
for a combo box, then we are trying to close the current form and display the
new form. The forms are mdi child of a MDI form named as MasterForm.
The code being used to close the current form and open the new form is as
follows:
lForm = new TestForm
lForm.MdiParent = Me.MdiParent
lForm.Show()
Me.Close()
Problem is on Selected value changed event, we get an unhandled exception,
Object reference not set to an instance of Object. I debugged and found that
while closing the current form, its throwing the error.
Can anyone please suggest this behaviour, is it a known issue.
Thanks,
Vinay Kant Tag: OT: Find pattern in sound Tag: 106218
Errror With mscorlib.dll - Please Help me
Everytime I Use ImageList Control to add Image that has more than 256Bits
colours and then an Exception throws at the line:
imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")))
All I have to do is create new Windows Application Project, then add an
ImageList Control to the form and then add an image likes 16bit colors to
Imagelist. Then Run.
When Run, an Run-time exception has thrown, the contain of exception:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
After that, every time I try to run Search in Windows Explorer, it returs
errror:
Unexpected Errors
Action could not be completed.
Anyone can show me how to solve this problem. I'm in hurry
I'm using Windows Server 2003, Visual Studio .NET 2003 and Framework version
v1.1.4322.
Thanks a lot. Tag: OT: Find pattern in sound Tag: 106211
Range of Values
Does .Net framework has class that
can support the computation of range of values?
For example, if I have a range of [1.23,4.45)
and i can subtract a range (1.5,2.3]
and will get a range of [1.23,1.5], (2.3,4.45)
Thanks. Tag: OT: Find pattern in sound Tag: 106209
text box and SqlDecimal datatypes
Hi all, I have a DAL which takes in a value as shown below ready for my
MSSQL stored procedure.
protected SqlDecimal _annualLeave = SqlDecimal.Null;
public SqlDecimal AnnualLeave
{
get {return _annualLeave;}
set{ _annualLeave = value;}
}
I have a problem where when I try to pass in information from a textbox on a
ASP.NET page OR Winform the *damn* thing gets rounded to an Integer!
I thought I could just go..
((System.Data.SqlDecimal)AnnualLeave.Text)
Where AnnualLeave.Text is the value of my textbox on my form, but I received
"Cannot convert type 'string' to 'System.Data.SqlTypes.SqlDecimal" error
(Which is fair enough)
So, I tried
((System.Data.SqlDecimal)(Convert.ToDecimal(AnnualLeave.Text))
but for some reason, this rounds the number to an integer!! e.g. 12.2
becomes 12!!!!!
Can someone please tell me what am I doing wrong here, it's been a long day
:P
Thanks
Mark Tag: OT: Find pattern in sound Tag: 106205
Visual Studio 2005 Question regarding Multi Framework support.
I heard somewhere that you can use the Visual Studio 2005 IDE to continue
work on VS2003 applications.
The reason for my question is I am rebuilding my machine this week and I
want to know if in need to install both VS2003 and VS2005 IDE's.
Thanks,
Red Tag: OT: Find pattern in sound Tag: 106204
ListView columns resizing
Hi,
Is there a way to get notified when the user tries to resize a column in a
ListView ( set for Details view).
Thank you Tag: OT: Find pattern in sound Tag: 106196
How to determine application to launch
How can I determine the correct type of application to launch from a file
extension, in C#?
I would prefer not to have to get a user to find the application executable. Tag: OT: Find pattern in sound Tag: 106191
Custom Compile Time Attributes?
I am trying to implment some business level user authorization in my current
.net 1.1 app. In C#, I would like to do something like:
[AuthorizationRule( "SomeRuleName" )]
public void MethodRequiringAuthorization()
{
... some code that requires authorization
}
But then have this code changed at compile time to something like:
public void MethodRequiringAuthorization()
{
if( Principal.Authorize( "SomeRuleName" ) )
{
... some code that requires authorization
}
}
Is there a way to do this? If not, is there some other way I can accomplish
the desired effect which is to decorate code with authorization rules
instead having to actually code it?
TIA// Tag: OT: Find pattern in sound Tag: 106179
SaveFileDialog
Hello,
I am programmatically creating a System.Windows.Forms.SaveFileDialog.
Everything works fine, however, I want to be able to detect when somebody
changes the filter property. Basically, I want to know when the file
extension is changed by the user so that I can automatically update the
filename property to have this extension at the end of the filename.
However, I can't seem to find some type of onfilterchange event to handle
this.
Does anybody have any ideas?
Thanks,
-- John Tag: OT: Find pattern in sound Tag: 106174
1.1 runtime required?
Scenario: i have some applications (exe and dll) compiled in Vs2003 using
default options.
On a clean machine, if i install only .net framework 2.0, will these
applications run? Tag: OT: Find pattern in sound Tag: 106169
Compisite Custom Controls - Event Handlers
Hi,
Im doing something really stupid here, But I cant see the wood for the
trees. This is some of the code for my custom composite control. It renders
fine and the buttons do cause a Post to occur. But the Click Handlers are
not are never receiving a click event. I note that the name of the control
is _ctl0 or 1 etc.
<span id="MyDamnButton1" style="width:192px;Z-INDEX: 101; LEFT: 16px;
POSITION: absolute; TOP: 24px"><input type="submit" name="_ctl0"
value="Submit Me" /><input type="submit" name="_ctl1" value="Submit Me 2"
/></span>
What could I have done wrong ?
------------------------
Protected btnSubmit As New System.Web.UI.WebControls.Button
Protected btnSubmit2 As New System.Web.UI.WebControls.Button
Protected Overrides Sub CreateChildControls()
btnSubmit.Text = "Submit Me"
btnSubmit2.Text = "Submit Me 2"
Controls.Add(btnSubmit)
Controls.Add(btnSubmit2)
AddHandler btnSubmit.Click, AddressOf Me.Click1Handler
AddHandler btnSubmit2.Click, AddressOf Me.Click1Handler2
End Sub
Private Sub Click1Handler(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim a As Int16 = 0
End Sub
Private Sub Click1Handler2(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim a As Int16 = 0
End Sub
--
Best Regards
The Inimitable Mr Newbie º¿º Tag: OT: Find pattern in sound Tag: 106167
C# compiler included?
Is the C# compiler included in the dot net framework for all users?
I am considering the development of a new "platform" for financial
institution simulation models used for risk management. To provide
flexibility, the platform needs to allow the user to write a small amount of
program code. I can include a compiler with the platform but would prefer to
simply use the C# compiler if it is already present on the computer of any
user with dot net installed.
So is the C# compiler included as part of the dot net framework?
Thanks for any info.
Steve Strommen Tag: OT: Find pattern in sound Tag: 106158
Start application from service
Hello everyone,
I am writing a Windows service (in VB.net) that requires the assistance of a
separate "helper" executable. I would like for the service to be able to
automatically start the helper exe when the service starts, and likewise, to
be able to stop the helper exe when the service stops. The catch is that the
helper exe must run under the account of the current user and not under
Local System or Local Service.
I know I can do the following to start the helper in OnStart:
Process1.StartInfo.FileName = "C:\windows\notepad.exe" ' Example exe
Process1.StartInfo.UserName = My.User.Name
Process1.StartInfo.CreateNoWindow = False
Process1.Start()
But notepad.exe will run under the same account as the service (and not
under My.User.Name). I can't add Process1.StartInfo.Password to that because
I don't know the user's password.
Any suggestions/comments as to how I may be able to accomplish this are
appreciated! Tag: OT: Find pattern in sound Tag: 106157
What does Process.ProcessName exactly do?
Hello,
What exactly does property ProcessName on System.Diagnostics.Process object
do? Especially regarding to performance counters? Which performance counters
it updates? What if application references libraries which support
performance counters but are not loaded into process?
eXavier Tag: OT: Find pattern in sound Tag: 106149
Memory handling & loading/unloading DLLs
Hello,
I would like to know how exactly works loading/unloading of libraries in
.NET (1.1). I have an assembly X which references assembly Y. If no type from
Y is used and no method to Y is called, is Y loaded ? May a dll be ever
unloaded ? And how it works if managed code uses unmaneged libraries ?
The background of my question is that we are currently solving crashing of
our application written in .NET which uses DB2 Data managed provider from
HIS2004. We have DataAccess layer which is able to use SQL Server or/and DB2.
The functionality for DB2 is never used in the application, so DB2 Data
provider assembly and I expect no one of its dependant native modules from
HIS should be loaded. But using Debugging Tools for Windows and ADPlus script
shows that those DLLs are unloaded. Later then, in logging library is used
call System.Diagnostic.Process.GetCurrentProcess().ProcessName to get process
name used in log entry. This call causes handling of some performance
counters probably in the unloaded DLLs. This is what we got from memory dump.
There is no mention about Performance counters logic in porperty ProcessName
in MSDN. However, with this knowledge I found the dependency on Performance
counters by Google. But still I'd like to know the library handling in .NET.
Thanks,
eXavier Tag: OT: Find pattern in sound Tag: 106148
Uploading to a web from windows.forms application
Hi
I need to upload files programatically from a windows.forms application to a
web server hosting my domain. the web server dosen't have asp installed this
has to be done purely from the client end without any assistance from any
programs on the server end
so my app should be able to:
1. open a connection to the site
2. transfer a file fromt he client to a certain directory on the site
3. cloes the connection to complete with no fuss.
thanks,
--Zacho Tag: OT: Find pattern in sound Tag: 106142
MSIL-IDE
For those trying to get ILIDE# I'm sharing at my blog site. The original
creator's site is failing.
http://porkster.homeip.net/ Tag: OT: Find pattern in sound Tag: 106133
Will Visual Stuido Enrich MSIL coding?
Will Visual Studio Enrich MSIL coding? I can't find any environment or
templates or MSIL coding in VS? Can someone explain the situation please? Tag: OT: Find pattern in sound Tag: 106131
beta2 & final release
I won't have VS before a little while (time for me to order it tuesday +
time to ship it), but I was wondering:
If I release a product build on beta 2 (with VS.NET 2005 beta 2), will it
work on the final release of .NET 2.0 ? Tag: OT: Find pattern in sound Tag: 106124
.NET 1.1 Components under 2.0
Hi,
If I develop an application using the .NET 2.0 Framework which has a
component specifically designed for 1.1 (such as VSFlexGrid.NET) do I need to
install both .NET 1.1 and 2.0 re-distributables on the target machines?
Thanks a bunch.
-- Val Tag: OT: Find pattern in sound Tag: 106112
Anyone ever seen this "System.ComponentModel.Win32Exception: Access is denied Exception."
I have a program that is printing PDFs and to check that the PDF is complete
we run the following code after we are done printing.
lpsProcesses = Process.GetProcesses
For Each lpsProcess In lpsProcesses
If lpsProcess.ProcessName.CompareTo("Acrobat") = 0 Then
lpsProcess.Close()
End If
Next
Now this works great on most of my users computer. But on some users
computers, all at the same company, on the same domain, etc. this code
generates the following error:
System.ComponentModel.Win32Exception: Access is denied
at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32
access, Boolean throwIfExited)
at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId)
at System.Diagnostics.Process.get_Modules()
at System.Diagnostics.Process.get_MainModule()
at System.Diagnostics.Process.get_ProcessName()
at ActNotesMod.frmPreview.PrintPA(IPDFPrinter pobjPrinter, Boolean
pbUseDefaultPrinter, String psPrinterName)
at ActNotesMod.frmActNotes.OutputPDF(Boolean pbPrint)
It is my belief that the problem is some type of rights issue with some
process that I do not know. Anyone out there that knows what a user has to
have rights to in order to run this code and use the "System.Diagnostics"
object?
The file they are printing is in their Document and Settings folder so they
have full access. They are network users so they are not admins on the
computers.
Any help would be GREAT!!!!!!!!!!
Clyde Tag: OT: Find pattern in sound Tag: 106102
HTML Encoded Email
I used to use the old CDO.Message.CreateMHTMLBODY() method to encode a web
page and send it as an email. Encoding HTML is pretty simple but when you
have associated images CDO.Message was the way to go.
I never found an easy way to do this with version 1.x of the framework. Is
there anything in 2.0 that will do this or do I still need to interop with
CDO?
Thanks,
-Andrew Tag: OT: Find pattern in sound Tag: 106100
SecurityException on AppDomain.CreateInstanceAndUnWrap
I am getting a SecurityException on calling
AppDomain.CurrentDomain.CreateInstanceAndUnwrap. The type referenced in the
call is in a referenced assembly. I cannot seem to get the SecurityException
to go away unless I use FullTrust. However, I don't see anywhere that this
is a documented security requirement.
--
James Tag: OT: Find pattern in sound Tag: 106097
Drawing to Multi-monitor independent display
How does one draw an image to an independent display (dual-monitor) using
.NET Framework code? In the application the OnPaint method is overridden so
that the modified image can be manipulated before drawn to the screen. The
application is a screensaver, so this needs to cover the independent displays
as well as the primary displays.
The image stretches on dual monitors where the second monitor is an
extension of the desktop, but ignores the dual monitors that are configured
as "independent" displays.
What I would like to accomplish is two-fold: (1) Make the same image appear
on all the monitors sized to only the screen dimensions regardless of whether
or not the second monitor extends the normal desktop, and (2) detect whether
the attached monitor is an independent display. Tag: OT: Find pattern in sound Tag: 106095
programming custom msn messenger drawing tool with messenger API?
Is there a .NET compatable msn messenger api that would let you program
a custom messenger client with a more full featured drawing tool? (with
the features you might find in Word, or even Illustrator / CorelDRAW)
Has anyone made anything like this? Tag: OT: Find pattern in sound Tag: 106089
Learning asp.net framework -- what version? use 1.1 or 2.0 / VS.Net 2003 or 2005 ???
Hi all,
I'm just setting out to learn VB.Net to use with ASP.Net Framework, and
I currently have Visual Studio.Net 2003. I keep reading Visual
Studio.Net 2005 is out, so should I try to get this instead of using
2003? Also is 2003 using ASP.Net 1.1 and 2005 using 2.0? Just
checking -- I'm a rookie when it comes to this since I'm just now
starting to learn how everything ties into everything else.
Thanks ---
Sam Tag: OT: Find pattern in sound Tag: 106085
Hi,
do you know any sw, whis find pattern (+- %) in specific sound file and
retur position