You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.IO;
using Teamcenter.Hello;
using Teamcenter.ClientX;
namespace HelloTeamcenter.form
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
public string m_WebAddress = "http://localhost:7001/tc";
public string username = "";
public string password = "";
public string usergroup = "";
public string userrole = "";
public Document appodc;
private void Login_Load(object sender, EventArgs e)
{
string tempdir = System.Environment.GetEnvironmentVariable("TEMP").ToString();
Editor ed = appodc.Editor;
ed.WriteMessage("login文件路径" + tempdir + "\n");
string loginfile = tempdir + "\\login.ini";
if (File.Exists(loginfile))
{
StreamReader sr = new StreamReader(loginfile);
string line;
if ((line = sr.ReadLine()) != null)
{
string[] ans = line.Split('|');
for (int i = 0; i < ans.Length; i++)
{
if (i == 0)
m_WebAddress = ans[i].ToString();
if (i == 1)
username = ans[i].ToString();
if (i == 3)
usergroup = ans[i].ToString();
if (i == 4)
userrole = ans[i].ToString();
}
}
sr.Close();
}
textBox1.Text = m_WebAddress;
textBox2.Text = username;
textBox3.Text = password;
textBox4.Text = usergroup;
textBox4.Text = userrole;
}
}
}