|
Hello
I wrote a form-based VB.NET application that also updates registy, uses 'common file-open dialog' and more.
It works perfectly.
The Problem:
When i run the exe file from another computer in the network, I get many security permission exceptions.
I get them when i try to :
* deal with registry
* when i access the common-dialog
* EVEN when i use 'END' statement to shut the application !
It can be solved by setting local .net framework security permissions on each computer. but im not satisfied with this solution. Is there any other solution in the programming-level??
Thanks ahead for an answer.
Uri
|
|
|
|
|
There is no programmatic way to get the permissions, since code running from a network source is not trusted. You MUST set this up either on each machine, or by using Group Policies in a domain environment.
Chapter 8 – Code Access Security in Practice[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What we do is to Create a standard .snk file and, you have a utility to create it aai believe it is called sn.exe run from the command line and get help to see how to use. Then I sign my assembilies with it look in the assembly.cs(.vb) file and add the location of your .snk file.
Now you can use the .NET configuration tool from start menu and tell your computer to trust applications that are signed with this key pair.
Use the same snk file for all your apps and the users would only have to set trust once. We had a programmmer that created MSI file that updated the Machine.config file to make it easier to set this trust policy. I could ony offer that we did that but I have no idea what the code looks like.
|
|
|
|
|
currently i'm doing my project and the title is SMS Voting that using VB to code.
The system operate :-
1. Once a question and the phone number display on screen, people can start sent SMS to vote their favorite contestant through their mobile phone
2. my system need a Nokia model 8210 which connected to my laptop with infra-red interface
3. when the nokia 8210 receive a vote then it will tranfer the vote into my laptop.
4. then the system will do some process and display a chart
my problem is how do i code the vote count convert to a chart ? and anyone can suggest web-site to me as referance ?
Hope u all can help me on this. Thanks
|
|
|
|
|
You can draw it yourself, or you can use a charting library. There are some good, free ones in .NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
well, meaning that i have to used VB.Net to code, is it ?
|
|
|
|
|
Well, seeing as you asked in the VB forum, I guess you'd choose VB to code it, yes.
If you're using VB6, you can still draw this stuff yourself. GDI+ makes it easier, tho.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<br />
Public Const RAS_MAXENTRYNAME As Integer = 256<br />
Public Const RAS_MAXDEVICETYPE As Integer = 16<br />
Public Const RAS_MAXDEVICENAME As Integer = 128<br />
Public Const RAS_RASCONNSIZE As Integer = 412<br />
Public Const ERROR_SUCCESS = 0&<br />
<br />
Public Type RasEntryName<br />
dwSize As Long<br />
szEntryName(RAS_MAXENTRYNAME) As Byte<br />
End Type<br />
<br />
Public Type RasConn<br />
dwSize As Long<br />
hRasConn As Long<br />
szEntryName(RAS_MAXENTRYNAME) As Byte<br />
szDeviceType(RAS_MAXDEVICETYPE) As Byte<br />
szDeviceName(RAS_MAXDEVICENAME) As Byte<br />
End Type<br />
<br />
Public Declare Function RasEnumConnections Lib "rasapi32.DLL" _<br />
Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, _<br />
lpcConnections As Long) As Long<br />
Public Declare Function RasHangUp Lib "rasapi32.DLL" Alias _<br />
"RasHangUpA" (ByVal hRasConn As Long) As Long<br />
Public gstrISPName As String<br />
Public ReturnCode As Long<br />
<br />
|
|
|
|
|
It declares some constants, types, and methods from the windows api "rasapi32"
RAS was to do with interacting with a modem (can't remember what it actually stands for .. Remote Access S.... maybe)
RasEnumConnections - I would guess this enumerates all the currently open connections
RasHangUp - I would imagine this hangs up a given connection.
www.pinvoke.net for more info.
|
|
|
|
|
hello
iam new to .net
i am working with treeview
iwant to generate a binary structure in treeview in the form one parent and two children and so on..............
code for the first node .......
treeview1.nodes.add(xxx)
and for the children.....
treeview1.nodes(0).nodes.add(xxx)
treeview1.nodes(0).nodes.add(xxx)
and for the next....
treeview1.nodes(0).nodes(0).nodes.add(xxx)
treeview1.nodes(0).nodes(0).nodes.add(xxx)
and so on..............
is there any chance of looping them then how
plz any one can helpme?.....
mamatha
-- modified at 6:48 Wednesday 4th January, 2006
|
|
|
|
|
HI,
I AM CREATING A PARENT NODE THEN CHILD FROM DATABASE.
FOR THAT I HAVE USED 2 DATASET AND 2 SQL STATEMENTS.
'***************Adding Root Node**********************
TreeView1.Nodes.Add("PARENT")
'*********************End*****************************
'***************Adding Child Node*********************
For i = 0 To ds1.Tables(0).Rows.Count - 1
Dim ndNodes As TreeNodeCollection, ndNode As TreeNode
ndNodes = Me.TreeView1.Nodes
For Each ndNode In ndNodes
ndNode.Nodes.Add("" & ds1.Tables(0).Rows(i)(0) & " " & ds1.Tables(0).Rows(i)(1) & "")
Next
'******************End*****************************
'***************Adding Sub Child Node**************
Dim temp1 As String = ds1.Tables(0).Rows(i)(0)
Dim sql2 As String = "SELECT a,b,c FROM xyz"
adpt2 = New OleDbDataAdapter(sql2, conn)
adpt2.Fill(ds2, "TPSAT")
For j = 0 To ds2.Tables(0).Rows.Count - 1
Dim ndNodes1 As TreeNodeCollection
ndNodes1 = Me.TreeView1.Nodes(0).Nodes
ndNode = Me.TreeView1.Nodes(0).LastNode
ndNode.Nodes.Add("" & ds2.Tables(0).Rows(j)(0) & " " & ds2.Tables(0).Rows(j)(1) & "")
'***************************************end*****************************************************************
Paritosh
|
|
|
|
|
hi,
thanks for the faster reply
but it is not exactly what i want
i want the tree to be in a binary format
1
.
....2..
.*****....4..
.*****....5..
.
....3..
******....6..
******....7..
and so on
and iam taking only one table ok
thanks in advance
-- modified at 7:41 Wednesday 4th January, 2006
|
|
|
|
|
First a disclaimer: to understand recursion you must first understand recursion
You want to add X number of nodes, each with 2 children and you want this to go for Y depth?
We will:
Call X - topLevelNodeCount
Call Y - treeDepth
Simply drop a tree view on the form named "treeView" and pase this code in your form
<code><pre>int topLevelNodeCount = 3;
int treeDepth = 5;
protected override void OnLoad(EventArgs e)
{
for(int i = 0;i<topLevelNodeCount;i++)
{
TreeNode newNode = new TreeNode("Top" + i);
this.treeView.Nodes.Add(newNode);
this.AddBinaryNode(newNode,1);
}
base.OnLoad (e);
}
private void AddBinaryNode(TreeNode parent, int depth)
{
// add 1
parent.Nodes.Add(parent.Text + "_Child1");
// add 2
parent.Nodes.Add(parent.Text + "_Child2");
if(depth < treeDepth)
{
int newDepth = depth+1;
AddBinaryNode(parent.Nodes[0],newDepth);
AddBinaryNode(parent.Nodes[1],newDepth);
}
}</pre></code>
-- modified at 8:49 Wednesday 4th January, 2006
|
|
|
|
|
HI,
THANK U VERY MUCH
THIS IS WHAT EXACTLY I WANT
ONCE AGAIN THANK U
-- modified at 0:18 Thursday 5th January, 2006
|
|
|
|
|
|
hi,
iam again
i have modify the code and igot the result but how ican get the nodes which are remaining that is if the binary tree is not balanced and we have some nodes balance after the "treedepth"
***********************************0
******************************1*********2
***************************3*****4****5****6
************************7*****8
in this way
how to add 7 and 8 here
and my modified code is(in the load i have added one "top1" node)
===============================function========================================
Private Sub AddBinaryNode(ByVal parent1, ByVal startlevel, ByVal i, ByVal treelevel, ByVal balancenodes)
da1 = New SqlDataAdapter("select trackid,username,parentid from users", CON)
da1.Fill(ds1, "users")
Dim count As Integer = ds1.Tables(0).Rows.Count - 1
'-------- add 1-------
parent1.Nodes.Add(ds1.Tables(0).Rows(i)(0))
'-------- add 2-------
MsgBox(parent1.text)
MsgBox(i)
Dim fnl As Integer = i
j = i + 1
MsgBox(j)
parent1.Nodes.Add(ds1.Tables(0).Rows(j)(0))
i = (i * 2) + 1
Dim newlevel As Int16
If (startlevel < treelevel) Then
newlevel = startlevel + 1
AddBinaryNode(parent1.Nodes(0), newlevel, i, treelevel, balancenodes)
AddBinaryNode(parent1.Nodes(1), newlevel, i + 2, treelevel, balancenodes)
End If
End Sub
======================end function================
-- modified at 0:28 Friday 6th January, 2006
|
|
|
|
|
Is there any way to find the creator/author name of a folder using vb.net?
Please guide me with sample codings.
Thanks in advance.
|
|
|
|
|
hi kavitha,
I am a beginer to vb.net. so sample code for you. i get it from internet.
Dim filename as string="c:\test\test.doc"
Dim dso As DSOFile.OleDocumentProperties
dso = New DSOFile.OleDocumentProperties
dso.Open(filename.Trim, True, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess)
Console.WriteLine(dso.SummaryProperties.Author)
Console.WriteLine(dso.SummaryProperties.ByteCount)
Console.WriteLine(dso.SummaryProperties.CharacterCount)
Console.WriteLine(dso.SummaryProperties.CharacterCountWithSpaces)
Console.WriteLine(dso.SummaryProperties.Comments)
Console.WriteLine(dso.SummaryProperties.Company)
Console.WriteLine(dso.SummaryProperties.DateCreated)
Console.WriteLine(dso.SummaryProperties.DateLastSaved)
Console.WriteLine(dso.SummaryProperties.LastSavedBy)
Console.WriteLine(dso.SummaryProperties.LineCount)
Console.WriteLine(dso.SummaryProperties.PageCount)
Console.WriteLine(dso.SummaryProperties.ParagraphCount)
Console.WriteLine(dso.SummaryProperties.RevisionNumber)
Console.WriteLine(dso.SummaryProperties.Subject)
Console.WriteLine(dso.SummaryProperties.Title)
Console.WriteLine(dso.SummaryProperties.WordCount)
thz
kamal.
|
|
|
|
|
hi Experts,
This is uttam.I've 2 devlope an application where in i need to copy an image from a web page then pase it to excel sheet. So can any body suggest me how can i do that.
I wish 2 use clipboard to keep copied picture for pasteing in excel sheet.
Hope u r getting my problem.Pls help me.It's urgent.every help will be appriciated.
Thanks n Regards
Uttam
try to be the best... whereever you go,
|
|
|
|
|
Hi all,
Im looking for an organizational chart/organogram that I can use to draw a company structure, BUT i must be able to populate it programmatically. So if I have a structured document/string in XML format etc the component then draws it.
I've looked at smartdraw and the chart generator by enlightened software but they dont seem to do the trick
Do you know of any component that offers this sort of functionality?
Thanks
Q
Quintes
|
|
|
|
|
Oh yeah, it must be a COM component, for use in VB 6.
Quintes
|
|
|
|
|
Hi ,
I have a VB active X control which has a few buttons on it. I have added the Tab order for these buttons.
I am using this ActiveX on a VC++ dialog. It is a simple dialog application.
and the Active X control is the only control on the VC++ dialog.
When I launch the application the focus does not go to the First button on the VB ActiveX.
I have found that the User control(Active X) gets the focus and not the First control on the User Control.
Can anyone help me out with this(Do I need to set any property??)
Gayathri
|
|
|
|
|
Can anyone help me with linking this Jet database file(Access) on a FTP
Server(changes to be made on the database on server) to my VB Application using ADO. It would be nice if someone just
gives me a sample code for this.
Can also this be done using a .udl file?
Please help...
Roshan
|
|
|
|
|
Won't work over FTP.
You can only use an Access database if you have a server component, like a web service, interacting with the database for your application, or your application must be able to get to the .MDB file through a file share, UNC path, or other mapped drive.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Happy New Year!!!!
I wanted to know how to make my web based ASP.Net application an intranet application.I know i can use authentication/authorization to do it.But I donot want a login page or something along those lines.I just donot want any one who's not a member of the intranet to view the site.I also want to know how i can accomplish the same thing in ASP.Would appreciate if someone can help me out in this.
Thanks,
Aanchal.
|
|
|
|